summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/issue_label.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-10-15 13:03:05 +0800
committerGitHub <noreply@github.com>2019-10-15 13:03:05 +0800
commit20477a69ea123a7800ebf94bfd2225eb9ae90e8f (patch)
tree0e01914d69bd5dbda358c7c5ce90c375e0f29be0 /routers/api/v1/repo/issue_label.go
parent34fb9d68a5567423ddde736ff42f9780f4048366 (diff)
downloadgitea-20477a69ea123a7800ebf94bfd2225eb9ae90e8f.tar.gz
gitea-20477a69ea123a7800ebf94bfd2225eb9ae90e8f.zip
Move clearlabels from models to issue service (#8326)
* move clearlabels from models to issue service * improve code * Apply suggestions from code review Co-Authored-By: zeripath <art27@cantab.net>
Diffstat (limited to 'routers/api/v1/repo/issue_label.go')
-rw-r--r--routers/api/v1/repo/issue_label.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/api/v1/repo/issue_label.go b/routers/api/v1/repo/issue_label.go
index e66bc35e90..7bd76c24c2 100644
--- a/routers/api/v1/repo/issue_label.go
+++ b/routers/api/v1/repo/issue_label.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
api "code.gitea.io/gitea/modules/structs"
+ issue_service "code.gitea.io/gitea/services/issue"
)
// ListIssueLabels list all the labels of an issue
@@ -314,7 +315,7 @@ func ClearIssueLabels(ctx *context.APIContext) {
return
}
- if err := issue.ClearLabels(ctx.User); err != nil {
+ if err := issue_service.ClearLabels(issue, ctx.User); err != nil {
ctx.Error(500, "ClearLabels", err)
return
}