aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-06-16 20:39:52 +0800
committerGitHub <noreply@github.com>2019-06-16 20:39:52 +0800
commitd8168b356d3ddaf3c38815a46ab075bf5bbe93c6 (patch)
tree96d31b185042027171574e6a370c90f6b3b0e508 /routers
parent367aeb169ac9f213a047bad24bbb3a4f58e3362a (diff)
downloadgitea-d8168b356d3ddaf3c38815a46ab075bf5bbe93c6.tar.gz
gitea-d8168b356d3ddaf3c38815a46ab075bf5bbe93c6.zip
Add missing description of label on API (#7159)
* add missing description of label on API * fix comment head * fix swagger
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/label.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/routers/api/v1/repo/label.go b/routers/api/v1/repo/label.go
index 1cd8890ca9..98ccee37bd 100644
--- a/routers/api/v1/repo/label.go
+++ b/routers/api/v1/repo/label.go
@@ -125,9 +125,10 @@ func CreateLabel(ctx *context.APIContext, form api.CreateLabelOption) {
// "201":
// "$ref": "#/responses/Label"
label := &models.Label{
- Name: form.Name,
- Color: form.Color,
- RepoID: ctx.Repo.Repository.ID,
+ Name: form.Name,
+ Color: form.Color,
+ RepoID: ctx.Repo.Repository.ID,
+ Description: form.Description,
}
if err := models.NewLabel(label); err != nil {
ctx.Error(500, "NewLabel", err)
@@ -185,6 +186,9 @@ func EditLabel(ctx *context.APIContext, form api.EditLabelOption) {
if form.Color != nil {
label.Color = *form.Color
}
+ if form.Description != nil {
+ label.Description = *form.Description
+ }
if err := models.UpdateLabel(label); err != nil {
ctx.ServerError("UpdateLabel", err)
return