0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-08-26 08:07:17 +02:00

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

Backport #35346 by @lunny

Fix #35296

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Giteabot 2025-08-26 00:29:44 +08:00 committed by GitHub
parent cc5ccf44dc
commit cbc595b9d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}