mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
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:
@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user