Improvements

This commit is contained in:
Lunny Xiao 2025-05-09 22:15:21 -07:00
parent bb1657a6e2
commit d0ff33f007

View File

@ -609,12 +609,8 @@ func editIssueComment(ctx *context.APIContext, form api.EditIssueCommentOption)
return
}
if form.Body != comment.Content {
oldContent := comment.Content
if form.Body == oldContent {
ctx.JSON(http.StatusOK, convert.ToAPIComment(ctx, ctx.Repo.Repository, comment))
return
}
comment.Content = form.Body
if err := issue_service.UpdateComment(ctx, comment, comment.ContentVersion, ctx.Doer, oldContent); err != nil {
if errors.Is(err, user_model.ErrBlockedUser) {
@ -624,6 +620,7 @@ func editIssueComment(ctx *context.APIContext, form api.EditIssueCommentOption)
}
return
}
}
ctx.JSON(http.StatusOK, convert.ToAPIComment(ctx, ctx.Repo.Repository, comment))
}