mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Move notification interface to services layer (#26915)
Extract from #22266
This commit is contained in:
@@ -24,7 +24,6 @@ import (
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/notification"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
@@ -36,6 +35,7 @@ import (
|
||||
"code.gitea.io/gitea/services/forms"
|
||||
"code.gitea.io/gitea/services/gitdiff"
|
||||
issue_service "code.gitea.io/gitea/services/issue"
|
||||
notify_service "code.gitea.io/gitea/services/notify"
|
||||
pull_service "code.gitea.io/gitea/services/pull"
|
||||
repo_service "code.gitea.io/gitea/services/repository"
|
||||
)
|
||||
@@ -594,11 +594,11 @@ func EditPullRequest(ctx *context.APIContext) {
|
||||
}
|
||||
|
||||
if titleChanged {
|
||||
notification.NotifyIssueChangeTitle(ctx, ctx.Doer, issue, oldTitle)
|
||||
notify_service.IssueChangeTitle(ctx, ctx.Doer, issue, oldTitle)
|
||||
}
|
||||
|
||||
if statusChangeComment != nil {
|
||||
notification.NotifyIssueChangeStatus(ctx, ctx.Doer, "", issue, statusChangeComment, issue.IsClosed)
|
||||
notify_service.IssueChangeStatus(ctx, ctx.Doer, "", issue, statusChangeComment, issue.IsClosed)
|
||||
}
|
||||
|
||||
// change pull target branch
|
||||
@@ -622,7 +622,7 @@ func EditPullRequest(ctx *context.APIContext) {
|
||||
}
|
||||
return
|
||||
}
|
||||
notification.NotifyPullRequestChangeTargetBranch(ctx, ctx.Doer, pr, form.Base)
|
||||
notify_service.PullRequestChangeTargetBranch(ctx, ctx.Doer, pr, form.Base)
|
||||
}
|
||||
|
||||
// update allow edits
|
||||
|
Reference in New Issue
Block a user