diff options
author | zeripath <art27@cantab.net> | 2020-05-21 02:15:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 22:15:30 -0300 |
commit | 3eb323901c6ec791294db492783e202558c2824f (patch) | |
tree | 0422f11c5089213dfb165deb24f9861353599c80 /routers | |
parent | b797b76abd13beba348415bdb81c7d3593bb01f9 (diff) | |
download | gitea-3eb323901c6ec791294db492783e202558c2824f.tar.gz gitea-3eb323901c6ec791294db492783e202558c2824f.zip |
Fix repo-list private and total count bugs (#11500)
* Fix repo-list private and total count bugs
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Ensure limited and private org public repos are displayed on "private"
Signed-off-by: Andrew Thornton <art27@cantab.net>
* switch from onlyPrivate to is_private
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Generate swagger
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/repo.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index a724ebcc37..e5055daa2b 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -78,9 +78,9 @@ func Search(ctx *context.APIContext) { // in: query // description: include private repositories this user has access to (defaults to true) // type: boolean - // - name: onlyPrivate + // - name: is_private // in: query - // description: only include private repositories this user has access to (defaults to false) + // description: show only pubic, private or all repositories (defaults to all) // type: boolean // - name: template // in: query @@ -133,7 +133,6 @@ func Search(ctx *context.APIContext) { TopicOnly: ctx.QueryBool("topic"), Collaborate: util.OptionalBoolNone, Private: ctx.IsSigned && (ctx.Query("private") == "" || ctx.QueryBool("private")), - OnlyPrivate: ctx.IsSigned && ctx.QueryBool("onlyPrivate"), Template: util.OptionalBoolNone, StarredByID: ctx.QueryInt64("starredBy"), IncludeDescription: ctx.QueryBool("includeDesc"), @@ -169,6 +168,10 @@ func Search(ctx *context.APIContext) { opts.Archived = util.OptionalBoolOf(ctx.QueryBool("archived")) } + if ctx.Query("is_private") != "" { + opts.IsPrivate = util.OptionalBoolOf(ctx.QueryBool("is_private")) + } + var sortMode = ctx.Query("sort") if len(sortMode) > 0 { var sortOrder = ctx.Query("order") |