Browse Source

Allow deleting comment with content via API like web did (#35346)

Fix #35296
pull/33307/merge
Lunny Xiao 4 months ago committed by GitHub
parent
commit
c4fbccc4ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      routers/api/v1/repo/issue_comment.go

4
routers/api/v1/repo/issue_comment.go

@ -721,8 +721,8 @@ func deleteIssueComment(ctx *context.APIContext) { @@ -721,8 +721,8 @@ func deleteIssueComment(ctx *context.APIContext) {
if !ctx.IsSigned || (ctx.Doer.ID != comment.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull)) {
ctx.Status(http.StatusForbidden)
return
} else if comment.Type != issues_model.CommentTypeComment {
ctx.Status(http.StatusNoContent)
} else if !comment.Type.HasContentSupport() {
ctx.Status(http.StatusBadRequest)
return
}

Loading…
Cancel
Save