summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/label.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/label.go')
-rw-r--r--routers/api/v1/repo/label.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/api/v1/repo/label.go b/routers/api/v1/repo/label.go
index ca0d8392b8..1de5705aa2 100644
--- a/routers/api/v1/repo/label.go
+++ b/routers/api/v1/repo/label.go
@@ -55,6 +55,13 @@ func ListLabels(ctx *context.APIContext) {
return
}
+ count, err := models.CountLabelsByRepoID(ctx.Repo.Repository.ID)
+ if err != nil {
+ ctx.InternalServerError(err)
+ return
+ }
+
+ ctx.SetTotalCountHeader(count)
ctx.JSON(http.StatusOK, convert.ToLabelList(labels))
}