summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/issue.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-10-18 19:23:05 +0800
committerGitHub <noreply@github.com>2018-10-18 19:23:05 +0800
commitea619b39b2f2a3c1fb5ad28ebd4a269b2f822111 (patch)
treeef101ad2b39dc5be1744e4488bcdd5beab16e45d /routers/api/v1/repo/issue.go
parentdd62ca7ba9b49e799a8bea896cff1b209f813b7e (diff)
downloadgitea-ea619b39b2f2a3c1fb5ad28ebd4a269b2f822111.tar.gz
gitea-ea619b39b2f2a3c1fb5ad28ebd4a269b2f822111.zip
Add notification interface and refactor UI notifications (#5085)
* add notification interface and refactor UI notifications * add missing methods on notification interface and notifiy only issue status really changed * implement NotifyPullRequestReview for ui notification
Diffstat (limited to 'routers/api/v1/repo/issue.go')
-rw-r--r--routers/api/v1/repo/issue.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go
index f8ef0fe3d9..4b634c9ca6 100644
--- a/routers/api/v1/repo/issue.go
+++ b/routers/api/v1/repo/issue.go
@@ -13,6 +13,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/indexer"
+ "code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
@@ -207,6 +208,8 @@ func CreateIssue(ctx *context.APIContext, form api.CreateIssueOption) {
return
}
+ notification.NotifyNewIssue(issue)
+
if form.Closed {
if err := issue.ChangeStatus(ctx.User, ctx.Repo.Repository, true); err != nil {
if models.IsErrDependenciesLeft(err) {
@@ -337,6 +340,8 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) {
ctx.Error(500, "ChangeStatus", err)
return
}
+
+ notification.NotifyIssueChangeStatus(ctx.User, issue, api.StateClosed == api.StateType(*form.State))
}
// Refetch from database to assign some automatic values