mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Move issue change status from models to service (#8691)
This commit is contained in:
@ -448,7 +448,7 @@ func EditPullRequest(ctx *context.APIContext, form api.EditPullRequestOption) {
|
||||
return
|
||||
}
|
||||
if form.State != nil {
|
||||
if err = issue.ChangeStatus(ctx.User, api.StateClosed == api.StateType(*form.State)); err != nil {
|
||||
if err = issue_service.ChangeStatus(issue, ctx.User, api.StateClosed == api.StateType(*form.State)); err != nil {
|
||||
if models.IsErrDependenciesLeft(err) {
|
||||
ctx.Error(http.StatusPreconditionFailed, "DependenciesLeft", "cannot close this pull request because it still has open dependencies")
|
||||
return
|
||||
@ -456,8 +456,6 @@ func EditPullRequest(ctx *context.APIContext, form api.EditPullRequestOption) {
|
||||
ctx.Error(500, "ChangeStatus", err)
|
||||
return
|
||||
}
|
||||
|
||||
notification.NotifyIssueChangeStatus(ctx.User, issue, api.StateClosed == api.StateType(*form.State))
|
||||
}
|
||||
|
||||
// Refetch from database
|
||||
|
Reference in New Issue
Block a user