1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 02:08:36 +00:00

Move SetMerged to service layer (#33045)

No code change.
Extract from #32178
This commit is contained in:
Lunny Xiao
2024-12-29 23:04:03 -08:00
committed by GitHub
parent 8eecca3478
commit d45456b1b5
5 changed files with 65 additions and 65 deletions

View File

@@ -34,7 +34,7 @@ func UpdateIssueCols(ctx context.Context, issue *Issue, cols ...string) error {
return nil
}
func changeIssueStatus(ctx context.Context, issue *Issue, doer *user_model.User, isClosed, isMergePull bool) (*Comment, error) {
func ChangeIssueStatus(ctx context.Context, issue *Issue, doer *user_model.User, isClosed, isMergePull bool) (*Comment, error) {
// Reload the issue
currentIssue, err := GetIssueByID(ctx, issue.ID)
if err != nil {
@@ -134,7 +134,7 @@ func CloseIssue(ctx context.Context, issue *Issue, doer *user_model.User) (*Comm
}
defer committer.Close()
comment, err := changeIssueStatus(ctx, issue, doer, true, false)
comment, err := ChangeIssueStatus(ctx, issue, doer, true, false)
if err != nil {
return nil, err
}
@@ -159,7 +159,7 @@ func ReopenIssue(ctx context.Context, issue *Issue, doer *user_model.User) (*Com
}
defer committer.Close()
comment, err := changeIssueStatus(ctx, issue, doer, false, false)
comment, err := ChangeIssueStatus(ctx, issue, doer, false, false)
if err != nil {
return nil, err
}