diff options
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/v1/repo/tag.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/routers/api/v1/repo/tag.go b/routers/api/v1/repo/tag.go index eb99895c64..76c612bea4 100644 --- a/routers/api/v1/repo/tag.go +++ b/routers/api/v1/repo/tag.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" api "code.gitea.io/gitea/modules/structs" + "code.gitea.io/gitea/routers/api/v1/utils" ) // ListTags list all the tags of a repository @@ -30,11 +31,21 @@ func ListTags(ctx *context.APIContext) { // description: name of the repo // type: string // required: true + // - name: page + // in: query + // description: page number of results to return (1-based) + // type: integer + // - name: limit + // in: query + // description: page size of results, default maximum page size is 50 + // type: integer // responses: // "200": // "$ref": "#/responses/TagList" - tags, err := ctx.Repo.GitRepo.GetTagInfos() + listOpts := utils.GetListOptions(ctx) + + tags, err := ctx.Repo.GitRepo.GetTagInfos(listOpts.Page, listOpts.PageSize) if err != nil { ctx.Error(http.StatusInternalServerError, "GetTags", err) return |