diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-10-15 13:03:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-15 13:03:05 +0800 |
commit | 20477a69ea123a7800ebf94bfd2225eb9ae90e8f (patch) | |
tree | 0e01914d69bd5dbda358c7c5ce90c375e0f29be0 /routers/repo | |
parent | 34fb9d68a5567423ddde736ff42f9780f4048366 (diff) | |
download | gitea-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/repo')
-rw-r--r-- | routers/repo/issue_label.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/repo/issue_label.go b/routers/repo/issue_label.go index 452a0a4c0c..53c37e2e97 100644 --- a/routers/repo/issue_label.go +++ b/routers/repo/issue_label.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" + issue_service "code.gitea.io/gitea/services/issue" ) const ( @@ -132,7 +133,7 @@ func UpdateIssueLabel(ctx *context.Context) { switch action := ctx.Query("action"); action { case "clear": for _, issue := range issues { - if err := issue.ClearLabels(ctx.User); err != nil { + if err := issue_service.ClearLabels(issue, ctx.User); err != nil { ctx.ServerError("ClearLabels", err) return } |