File tree 3 files changed +27
-4
lines changed
3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -1409,9 +1409,7 @@ type SearchUserOptions struct {
1409
1409
}
1410
1410
1411
1411
func (opts * SearchUserOptions ) toConds () builder.Cond {
1412
-
1413
- var cond = builder .NewCond ()
1414
- cond = cond .And (builder.Eq {"type" : opts .Type })
1412
+ var cond builder.Cond = builder.Eq {"type" : opts .Type }
1415
1413
1416
1414
if len (opts .Keyword ) > 0 {
1417
1415
lowerKeyword := strings .ToLower (opts .Keyword )
Original file line number Diff line number Diff line change @@ -82,6 +82,15 @@ func GetAllOrgs(ctx *context.APIContext) {
82
82
// summary: List all organizations
83
83
// produces:
84
84
// - 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
85
94
// responses:
86
95
// "200":
87
96
// "$ref": "#/responses/OrganizationList"
@@ -90,7 +99,9 @@ func GetAllOrgs(ctx *context.APIContext) {
90
99
users , _ , err := models .SearchUsers (& models.SearchUserOptions {
91
100
Type : models .UserTypeOrganization ,
92
101
OrderBy : models .SearchOrderByAlphabetically ,
93
- PageSize : - 1 ,
102
+ Page : ctx .QueryInt ("page" ),
103
+ PageSize : convert .ToCorrectPageSize (ctx .QueryInt ("limit" )),
104
+ Private : true ,
94
105
})
95
106
if err != nil {
96
107
ctx .Error (500 , "SearchOrganizations" , err )
Original file line number Diff line number Diff line change 33
33
],
34
34
"summary": "List all organizations",
35
35
"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
+ ],
36
50
"responses": {
37
51
"200": {
38
52
"$ref": "#/responses/OrganizationList"
You can’t perform that action at this time.
0 commit comments