diff options
author | caicandong <50507092+CaiCandong@users.noreply.github.com> | 2023-08-04 21:34:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 13:34:34 +0000 |
commit | 6151e69d9509c08e25e93743d6b31211371e81d0 (patch) | |
tree | 1e115a29a615805d0cc533b5de242dfe5adde80a /services/pull/review.go | |
parent | 2de0752be7aaab65fe670518d00175be479ea054 (diff) | |
download | gitea-6151e69d9509c08e25e93743d6b31211371e81d0.tar.gz gitea-6151e69d9509c08e25e93743d6b31211371e81d0.zip |
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>
Diffstat (limited to 'services/pull/review.go')
-rw-r--r-- | services/pull/review.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/services/pull/review.go b/services/pull/review.go index 59cc607912..58470142e1 100644 --- a/services/pull/review.go +++ b/services/pull/review.go @@ -20,7 +20,6 @@ import ( "code.gitea.io/gitea/modules/notification" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/util" - issue_service "code.gitea.io/gitea/services/issue" ) var notEnoughLines = regexp.MustCompile(`fatal: file .* has only \d+ lines?`) @@ -248,7 +247,7 @@ func createCodeComment(ctx context.Context, doer *user_model.User, repo *repo_mo return nil, err } } - return issue_service.CreateComment(ctx, &issues_model.CreateCommentOptions{ + return issues_model.CreateComment(ctx, &issues_model.CreateCommentOptions{ Type: issues_model.CommentTypeCode, Doer: doer, Repo: repo, @@ -340,7 +339,7 @@ func DismissApprovalReviews(ctx context.Context, doer *user_model.User, pull *is return err } - comment, err := issue_service.CreateComment(ctx, &issues_model.CreateCommentOptions{ + comment, err := issues_model.CreateComment(ctx, &issues_model.CreateCommentOptions{ Doer: doer, Content: "New commits pushed, approval review dismissed automatically according to repository settings", Type: issues_model.CommentTypeDismissReview, @@ -411,7 +410,7 @@ func DismissReview(ctx context.Context, reviewID, repoID int64, message string, return nil, err } - comment, err = issue_service.CreateComment(ctx, &issues_model.CreateCommentOptions{ + comment, err = issues_model.CreateComment(ctx, &issues_model.CreateCommentOptions{ Doer: doer, Content: message, Type: issues_model.CommentTypeDismissReview, |