Skip to content

Commit cbc595b

Browse files
GiteaBotlunny
andauthored
Allow deleting comment with content via API like web did (#35346) (#35354)
Backport #35346 by @lunny Fix #35296 Co-authored-by: Lunny Xiao <[email protected]>
1 parent cc5ccf4 commit cbc595b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routers/api/v1/repo/issue_comment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,8 @@ func deleteIssueComment(ctx *context.APIContext) {
721721
if !ctx.IsSigned || (ctx.Doer.ID != comment.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull)) {
722722
ctx.Status(http.StatusForbidden)
723723
return
724-
} else if comment.Type != issues_model.CommentTypeComment {
725-
ctx.Status(http.StatusNoContent)
724+
} else if !comment.Type.HasContentSupport() {
725+
ctx.Status(http.StatusBadRequest)
726726
return
727727
}
728728

0 commit comments

Comments
 (0)