fix: get tag use tagCount action

This commit is contained in:
yystopf 2022-03-10 17:27:26 +08:00
parent d12171ec72
commit 67a6b37966
1 changed files with 3 additions and 3 deletions

View File

@ -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)
}