|
|
@ -82,6 +82,15 @@ func GetAllOrgs(ctx *context.APIContext) { |
|
|
|
// summary: List all organizations
|
|
|
|
// summary: List all organizations
|
|
|
|
// produces:
|
|
|
|
// produces:
|
|
|
|
// - application/json
|
|
|
|
// - application/json
|
|
|
|
|
|
|
|
// parameters:
|
|
|
|
|
|
|
|
// - name: page
|
|
|
|
|
|
|
|
// in: query
|
|
|
|
|
|
|
|
// description: page number of results to return (1-based)
|
|
|
|
|
|
|
|
// type: integer
|
|
|
|
|
|
|
|
// - name: limit
|
|
|
|
|
|
|
|
// in: query
|
|
|
|
|
|
|
|
// description: page size of results, maximum page size is 50
|
|
|
|
|
|
|
|
// type: integer
|
|
|
|
// responses:
|
|
|
|
// responses:
|
|
|
|
// "200":
|
|
|
|
// "200":
|
|
|
|
// "$ref": "#/responses/OrganizationList"
|
|
|
|
// "$ref": "#/responses/OrganizationList"
|
|
|
@ -90,7 +99,9 @@ func GetAllOrgs(ctx *context.APIContext) { |
|
|
|
users, _, err := models.SearchUsers(&models.SearchUserOptions{ |
|
|
|
users, _, err := models.SearchUsers(&models.SearchUserOptions{ |
|
|
|
Type: models.UserTypeOrganization, |
|
|
|
Type: models.UserTypeOrganization, |
|
|
|
OrderBy: models.SearchOrderByAlphabetically, |
|
|
|
OrderBy: models.SearchOrderByAlphabetically, |
|
|
|
PageSize: -1, |
|
|
|
Page: ctx.QueryInt("page"), |
|
|
|
|
|
|
|
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")), |
|
|
|
|
|
|
|
Private: true, |
|
|
|
}) |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Error(500, "SearchOrganizations", err) |
|
|
|
ctx.Error(500, "SearchOrganizations", err) |
|
|
|