aboutsummaryrefslogtreecommitdiff
path: root/routers
diff options
context:
space:
mode:
authorwxiaoguang2023-03-04 15:13:37 +0800
committerGitHub2023-03-04 02:13:37 -0500
commit188c8c12c290e131fb342e3203634828652b0af5 (patch)
tree228bd46aa0aed2f059e7bd5a71ab42e7ceebe52e /routers
parent47b912cd526207f831bff759b29a734049d1c8f2 (diff)
Make Ctrl+Enter submit a pending comment (starting review) instead of submitting a single comment (#23245)
Close #23241 Before: press Ctrl+Enter in the Code Review Form, a single comment will be added. After: press Ctrl+Enter in the Code Review Form, start the review with pending comments. The old name `is_review` is not clear, so the new code use `pending_review` as the new name. Co-authored-by: delvh <leon@kske.dev> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/pull_review.go4
-rw-r--r--routers/web/repo/pull_review.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/repo/pull_review.go b/routers/api/v1/repo/pull_review.go
index f6acaa780..8f4b9dafe 100644
--- a/routers/api/v1/repo/pull_review.go
+++ b/routers/api/v1/repo/pull_review.go
@@ -268,7 +268,7 @@ func DeletePullReview(ctx *context.APIContext) {
ctx.Status(http.StatusNoContent)
}
-// CreatePullReview create a review to an pull request
+// CreatePullReview create a review to a pull request
func CreatePullReview(ctx *context.APIContext) {
// swagger:operation POST /repos/{owner}/{repo}/pulls/{index}/reviews repository repoCreatePullReview
// ---
@@ -360,7 +360,7 @@ func CreatePullReview(ctx *context.APIContext) {
line,
c.Body,
c.Path,
- true, // is review
+ true, // pending review
0, // no reply
opts.CommitID,
); err != nil {
diff --git a/routers/web/repo/pull_review.go b/routers/web/repo/pull_review.go
index d43a786c5..90cfd5bfc 100644
--- a/routers/web/repo/pull_review.go
+++ b/routers/web/repo/pull_review.go
@@ -77,7 +77,7 @@ func CreateCodeComment(ctx *context.Context) {
signedLine,
form.Content,
form.TreePath,
- form.IsReview,
+ !form.SingleReview,
form.Reply,
form.LatestCommitID,
)