mirror of https://github.com/go-gitea/gitea.git
Merge ecb4ae687e
into 91610a987e
This commit is contained in:
commit
ad3bf07eab
|
@ -76,6 +76,7 @@ func GetGitRefs(ctx *context.APIContext) {
|
|||
}
|
||||
|
||||
func getGitRefsInternal(ctx *context.APIContext, filter string) {
|
||||
listOptions := utils.GetListOptions(ctx)
|
||||
refs, lastMethodName, err := utils.GetGitRefs(ctx, filter)
|
||||
if err != nil {
|
||||
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])
|
||||
return
|
||||
}
|
||||
ctx.SetLinkHeader(len(apiRefs), listOptions.PageSize)
|
||||
ctx.SetTotalCountHeader(int64(len(apiRefs)))
|
||||
ctx.JSON(http.StatusOK, &apiRefs)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue