1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add pagination headers on endpoints that support total count from database (#11145)

* begin work

* import fmt

* more work

* empty commit

Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
Cirno the Strongest
2020-06-21 10:22:06 +02:00
committed by GitHub
parent a07cc0df76
commit 81324cf37c
9 changed files with 51 additions and 14 deletions

View File

@@ -322,6 +322,8 @@ func ListIssues(ctx *context.APIContext) {
}
ctx.SetLinkHeader(ctx.Repo.Repository.NumIssues, listOptions.PageSize)
ctx.Header().Set("X-Total-Count", fmt.Sprintf("%d", ctx.Repo.Repository.NumIssues))
ctx.JSON(http.StatusOK, convert.ToAPIIssueList(issues))
}