Add paging headers (#36521)
Adds support for paging in admin/hooks api endpoint fixes: https://github.com/go-gitea/gitea/issues/36516 --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com> Co-authored-by: techknowlogick <matti@mdranta.net>
This commit is contained in:
@@ -76,6 +76,7 @@ func GetStarredRepos(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
|
||||
ctx.SetLinkHeader(ctx.ContextUser.NumStars, utils.GetListOptions(ctx).PageSize)
|
||||
ctx.SetTotalCountHeader(int64(ctx.ContextUser.NumStars))
|
||||
ctx.JSON(http.StatusOK, &repos)
|
||||
}
|
||||
@@ -107,6 +108,7 @@ func GetMyStarredRepos(ctx *context.APIContext) {
|
||||
ctx.APIErrorInternal(err)
|
||||
}
|
||||
|
||||
ctx.SetLinkHeader(ctx.Doer.NumStars, utils.GetListOptions(ctx).PageSize)
|
||||
ctx.SetTotalCountHeader(int64(ctx.Doer.NumStars))
|
||||
ctx.JSON(http.StatusOK, &repos)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user