From 67a6b37966f32ec010daa31a1ed2b0cb93b39ee1 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 10 Mar 2022 17:27:26 +0800 Subject: [PATCH] fix: get tag use tagCount action --- routers/api/v1/repo/tag.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/api/v1/repo/tag.go b/routers/api/v1/repo/tag.go index 3ad3ed0a0..e446660c4 100644 --- a/routers/api/v1/repo/tag.go +++ b/routers/api/v1/repo/tag.go @@ -301,9 +301,9 @@ func BranchTagCount(ctx *context.APIContext) { // "200": // "$ref": "#/responses/RepoBranchAndTagCount" - tags, err := ctx.Repo.GitRepo.GetTagInfos(0, 0) // tags info + tagsCount, err := ctx.Repo.GitRepo.GetTagCount() // tags info if err != nil { - ctx.Error(http.StatusInternalServerError, "GetTags", err) + ctx.Error(http.StatusInternalServerError, "GetTagCount", err) return } repo := ctx.Repo.Repository @@ -314,7 +314,7 @@ func BranchTagCount(ctx *context.APIContext) { } result := api.RepoBranchAndTagCount{ BranchCount: countAll, - TagCount: len(tags), + TagCount: int(tagsCount), } ctx.JSON(http.StatusOK, result) }