[API] add GET /orgs endpoint (#9560)

* introduce `GET /orgs`

* add TEST

* show also other VisibleType's

* update description

* refactor a lot

* SearchUserOptions by default return only public
This commit is contained in:
6543 2020-01-12 16:43:44 +01:00 committed by Lunny Xiao
parent 497e15fdc2
commit 10055bd2b1
8 changed files with 108 additions and 9 deletions

View file

@ -104,7 +104,7 @@ func GetAllOrgs(ctx *context.APIContext) {
OrderBy: models.SearchOrderByAlphabetically,
Page: ctx.QueryInt("page"),
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
Private: true,
Visible: []api.VisibleType{api.VisibleTypePublic, api.VisibleTypeLimited, api.VisibleTypePrivate},
})
if err != nil {
ctx.Error(http.StatusInternalServerError, "SearchOrganizations", err)