forked from forgejo/forgejo
[GITEA] DELETE /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment}
* reuse deleteIssueComment by adding the commentType parameter * ensure tests start with a PR with no random reviews from fixtures Refs: https://codeberg.org/forgejo/forgejo/issues/2109 (cherry picked from commit5b90ab77f6
) (cherry picked from commit28ecd6f5a6
) (cherry picked from commit24870cf133
)
This commit is contained in:
parent
8eaa8aeaf9
commit
0b503e5e86
5 changed files with 156 additions and 6 deletions
|
@ -1014,6 +1014,53 @@ func UnDismissPullReview(ctx *context.APIContext) {
|
|||
dismissReview(ctx, "", false, false)
|
||||
}
|
||||
|
||||
// DeletePullReviewComment delete a pull review comment
|
||||
func DeletePullReviewComment(ctx *context.APIContext) {
|
||||
// swagger:operation DELETE /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment} repository repoDeletePullReviewComment
|
||||
// ---
|
||||
// summary: Delete a pull review comment
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: owner
|
||||
// in: path
|
||||
// description: owner of the repo
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: repo
|
||||
// in: path
|
||||
// description: name of the repo
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: index
|
||||
// in: path
|
||||
// description: index of the pull request
|
||||
// type: integer
|
||||
// format: int64
|
||||
// required: true
|
||||
// - name: id
|
||||
// in: path
|
||||
// description: id of the review
|
||||
// type: integer
|
||||
// format: int64
|
||||
// required: true
|
||||
// - name: comment
|
||||
// in: path
|
||||
// description: id of the comment
|
||||
// type: integer
|
||||
// format: int64
|
||||
// required: true
|
||||
// responses:
|
||||
// "204":
|
||||
// "$ref": "#/responses/empty"
|
||||
// "403":
|
||||
// "$ref": "#/responses/forbidden"
|
||||
// "404":
|
||||
// "$ref": "#/responses/notFound"
|
||||
|
||||
deleteIssueComment(ctx, issues_model.CommentTypeCode)
|
||||
}
|
||||
|
||||
func dismissReview(ctx *context.APIContext, msg string, isDismiss, dismissPriors bool) {
|
||||
if !ctx.Repo.IsAdmin() {
|
||||
ctx.Error(http.StatusForbidden, "", "Must be repo admin")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue