forked from forgejo/forgejo
Fix page and missing return on unadopted repos API (#18848)
* 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 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
3ba9dcf4b4
commit
1563a45623
3 changed files with 4 additions and 2 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue