From 495d5e4329326b27158a25b44c37986923d0bb6b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 28 Oct 2019 10:11:50 +0800 Subject: Move more issue assignee code from models to issue service (#8690) * Move more issue assignee code from models to issue service * fix test --- routers/repo/issue.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'routers') diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 94c39ae224..4e755b7191 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -1050,14 +1050,11 @@ func UpdateIssueTitle(ctx *context.Context) { return } - oldTitle := issue.Title if err := issue_service.ChangeTitle(issue, ctx.User, title); err != nil { ctx.ServerError("ChangeTitle", err) return } - notification.NotifyIssueChangeTitle(ctx.User, issue, oldTitle) - ctx.JSON(200, map[string]interface{}{ "title": issue.Title, }) @@ -1130,7 +1127,7 @@ func UpdateIssueAssignee(ctx *context.Context) { for _, issue := range issues { switch action { case "clear": - if err := models.DeleteNotPassedAssignee(issue, ctx.User, []*models.User{}); err != nil { + if err := issue_service.DeleteNotPassedAssignee(issue, ctx.User, []*models.User{}); err != nil { ctx.ServerError("ClearAssignees", err) return } @@ -1151,7 +1148,7 @@ func UpdateIssueAssignee(ctx *context.Context) { return } - removed, comment, err := issue.ToggleAssignee(ctx.User, assigneeID) + removed, comment, err := issue_service.ToggleAssignee(issue, ctx.User, assigneeID) if err != nil { ctx.ServerError("ToggleAssignee", err) return -- cgit v1.2.3