mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-15 18:05:04 +02:00
honor pagination queryparams on requests to /repo/git/refs
This commit is contained in:
parent
a25081f380
commit
ecb4ae687e
@ -76,6 +76,7 @@ func GetGitRefs(ctx *context.APIContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getGitRefsInternal(ctx *context.APIContext, filter string) {
|
func getGitRefsInternal(ctx *context.APIContext, filter string) {
|
||||||
|
listOptions := utils.GetListOptions(ctx)
|
||||||
refs, lastMethodName, err := utils.GetGitRefs(ctx, filter)
|
refs, lastMethodName, err := utils.GetGitRefs(ctx, filter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.APIErrorInternal(fmt.Errorf("%s: %w", lastMethodName, err))
|
ctx.APIErrorInternal(fmt.Errorf("%s: %w", lastMethodName, err))
|
||||||
@ -104,5 +105,7 @@ func getGitRefsInternal(ctx *context.APIContext, filter string) {
|
|||||||
ctx.JSON(http.StatusOK, &apiRefs[0])
|
ctx.JSON(http.StatusOK, &apiRefs[0])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
ctx.SetLinkHeader(len(apiRefs), listOptions.PageSize)
|
||||||
|
ctx.SetTotalCountHeader(int64(len(apiRefs)))
|
||||||
ctx.JSON(http.StatusOK, &apiRefs)
|
ctx.JSON(http.StatusOK, &apiRefs)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user