diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-10-19 17:48:29 +0800 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-10-19 12:48:29 +0300 |
commit | 280f4bebbf5883eef94d8a84b21575393ae5e0e1 (patch) | |
tree | 578594a27dbe25185ec5ce70f692e2f392d9b947 /routers | |
parent | 240f46a4220d9b8d38d084dca4ff47d442c12f9c (diff) | |
download | gitea-280f4bebbf5883eef94d8a84b21575393ae5e0e1.tar.gz gitea-280f4bebbf5883eef94d8a84b21575393ae5e0e1.zip |
Move issue label operations to issue service package (#8553)
* Move issue label operations to issue service package
* fix test
* fix fmt
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/issue_label.go | 2 | ||||
-rw-r--r-- | routers/repo/issue_label.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/repo/issue_label.go b/routers/api/v1/repo/issue_label.go index 7bd76c24c2..e41c1512e2 100644 --- a/routers/api/v1/repo/issue_label.go +++ b/routers/api/v1/repo/issue_label.go @@ -117,7 +117,7 @@ func AddIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) { return } - if err = issue.AddLabels(ctx.User, labels); err != nil { + if err = issue_service.AddLabels(issue, ctx.User, labels); err != nil { ctx.Error(500, "AddLabels", err) return } diff --git a/routers/repo/issue_label.go b/routers/repo/issue_label.go index 53c37e2e97..02568f77a6 100644 --- a/routers/repo/issue_label.go +++ b/routers/repo/issue_label.go @@ -162,14 +162,14 @@ func UpdateIssueLabel(ctx *context.Context) { if action == "attach" { for _, issue := range issues { - if err = issue.AddLabel(ctx.User, label); err != nil { + if err = issue_service.AddLabel(issue, ctx.User, label); err != nil { ctx.ServerError("AddLabel", err) return } } } else { for _, issue := range issues { - if err = issue.RemoveLabel(ctx.User, label); err != nil { + if err = issue_service.RemoveLabel(issue, ctx.User, label); err != nil { ctx.ServerError("RemoveLabel", err) return } |