forked from forgejo/forgejo
Delete issue_service.CreateComment
(#26298)
I noticed that `issue_service.CreateComment` adds transaction operations on `issues_model.CreateComment`, we can merge the two functions and we can avoid calling each other's methods in the `services` layer. Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
2de0752be7
commit
6151e69d95
5 changed files with 17 additions and 31 deletions
|
@ -125,7 +125,7 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, pull *issu
|
|||
Content: string(dataJSON),
|
||||
}
|
||||
|
||||
_, _ = issue_service.CreateComment(ctx, ops)
|
||||
_, _ = issues_model.CreateComment(ctx, ops)
|
||||
|
||||
if !pr.IsWorkInProgress() {
|
||||
if err := issues_model.PullRequestCodeOwnersReview(ctx, pull, pr); err != nil {
|
||||
|
@ -231,7 +231,7 @@ func ChangeTargetBranch(ctx context.Context, pr *issues_model.PullRequest, doer
|
|||
OldRef: oldBranch,
|
||||
NewRef: targetBranch,
|
||||
}
|
||||
if _, err = issue_service.CreateComment(ctx, options); err != nil {
|
||||
if _, err = issues_model.CreateComment(ctx, options); err != nil {
|
||||
return fmt.Errorf("CreateChangeTargetBranchComment: %w", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue