diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-10-28 10:11:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-28 10:11:50 +0800 |
commit | 495d5e4329326b27158a25b44c37986923d0bb6b (patch) | |
tree | fa8474775eb9a1bdb11380ca17a9ca42a991fcb3 /routers/repo/issue.go | |
parent | 018b0e818038f3c38cc6bfc96fadeb25c92380e6 (diff) | |
download | gitea-495d5e4329326b27158a25b44c37986923d0bb6b.tar.gz gitea-495d5e4329326b27158a25b44c37986923d0bb6b.zip |
Move more issue assignee code from models to issue service (#8690)
* Move more issue assignee code from models to issue service
* fix test
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r-- | routers/repo/issue.go | 7 |
1 files changed, 2 insertions, 5 deletions
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 |