File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -1376,9 +1376,7 @@ type SearchUserOptions struct {
13761376}
13771377
13781378func (opts * SearchUserOptions ) toConds () builder.Cond {
1379-
1380- var cond = builder .NewCond ()
1381- cond = cond .And (builder.Eq {"type" : opts .Type })
1379+ var cond builder.Cond = builder.Eq {"type" : opts .Type }
13821380
13831381 if len (opts .Keyword ) > 0 {
13841382 lowerKeyword := strings .ToLower (opts .Keyword )
Original file line number Diff line number Diff line change @@ -82,6 +82,15 @@ func GetAllOrgs(ctx *context.APIContext) {
8282 // summary: List all organizations
8383 // produces:
8484 // - application/json
85+ // parameters:
86+ // - name: page
87+ // in: query
88+ // description: page number of results to return (1-based)
89+ // type: integer
90+ // - name: limit
91+ // in: query
92+ // description: page size of results, maximum page size is 50
93+ // type: integer
8594 // responses:
8695 // "200":
8796 // "$ref": "#/responses/OrganizationList"
@@ -90,7 +99,9 @@ func GetAllOrgs(ctx *context.APIContext) {
9099 users , _ , err := models .SearchUsers (& models.SearchUserOptions {
91100 Type : models .UserTypeOrganization ,
92101 OrderBy : models .SearchOrderByAlphabetically ,
93- PageSize : - 1 ,
102+ Page : ctx .QueryInt ("page" ),
103+ PageSize : convert .ToCorrectPageSize (ctx .QueryInt ("limit" )),
104+ Private : true ,
94105 })
95106 if err != nil {
96107 ctx .Error (500 , "SearchOrganizations" , err )
Original file line number Diff line number Diff line change 3333 ],
3434 "summary": "List all organizations",
3535 "operationId": "adminGetAllOrgs",
36+ "parameters": [
37+ {
38+ "type": "integer",
39+ "description": "page number of results to return (1-based)",
40+ "name": "page",
41+ "in": "query"
42+ },
43+ {
44+ "type": "integer",
45+ "description": "page size of results, maximum page size is 50",
46+ "name": "limit",
47+ "in": "query"
48+ }
49+ ],
3650 "responses": {
3751 "200": {
3852 "$ref": "#/responses/OrganizationList"
You can’t perform that action at this time.
0 commit comments