From 280f4bebbf5883eef94d8a84b21575393ae5e0e1 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 19 Oct 2019 17:48:29 +0800 Subject: Move issue label operations to issue service package (#8553) * Move issue label operations to issue service package * fix test * fix fmt --- routers/api/v1/repo/issue_label.go | 2 +- routers/repo/issue_label.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'routers') 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 } -- cgit v1.2.3