1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-05 17:18:21 +00:00

Fix page and missing return on unadopted repos API (#18848) (#18927)

* Fix page and missing return on unadopted repos API

Page must be 1 if it's not specified and it should return after sending an internal server error.

* Allow ignore pages
This commit is contained in:
qwerty287
2022-02-27 13:18:23 +01:00
committed by GitHub
parent 4fb718d405
commit 054bc55a1c
5 changed files with 6 additions and 3 deletions

View File

@@ -43,9 +43,13 @@ func ListUnadoptedRepositories(ctx *context.APIContext) {
// "$ref": "#/responses/forbidden"
listOptions := utils.GetListOptions(ctx)
if listOptions.Page == 0 {
listOptions.Page = 1
}
repoNames, count, err := repo_service.ListUnadoptedRepositories(ctx.FormString("query"), &listOptions)
if err != nil {
ctx.InternalServerError(err)
return
}
ctx.SetTotalCountHeader(int64(count))