mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 02:21:17 +02:00
Fix the bug when the last code comment deleted, a review comment type comment is still in the activity list of the pull request
This commit is contained in:
8 files changed
+116
-15
No files matched your search
@@ -726,7 +726,7 @@ func deleteIssueComment(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
|
||||
if err = issue_service.DeleteComment(ctx, ctx.Doer, comment); err != nil {
|
||||
if _, err = issue_service.DeleteComment(ctx, ctx.Doer, comment); err != nil {
|
||||
ctx.APIErrorInternal(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -325,12 +325,18 @@ func DeleteComment(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if err = issue_service.DeleteComment(ctx, ctx.Doer, comment); err != nil {
|
||||
deletedReviewComment, err := issue_service.DeleteComment(ctx, ctx.Doer, comment)
|
||||
if err != nil {
|
||||
ctx.ServerError("DeleteComment", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Status(http.StatusOK)
|
||||
res := map[string]any{}
|
||||
if deletedReviewComment != nil {
|
||||
res["deletedReviewCommentHashTag"] = deletedReviewComment.HashTag()
|
||||
}
|
||||
|
||||
ctx.JSON(http.StatusOK, res)
|
||||
}
|
||||
|
||||
// ChangeCommentReaction create a reaction for comment
|
||||
|
||||
Reference in new issue
Block a user