aboutsummaryrefslogtreecommitdiff
path: root/routers/api
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo/issue_comment.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go
index fe94fd71..4934302f 100644
--- a/routers/api/v1/repo/issue_comment.go
+++ b/routers/api/v1/repo/issue_comment.go
@@ -92,8 +92,9 @@ func EditIssueComment(ctx *context.APIContext, form api.EditIssueCommentOption)
return
}
+ oldContent := comment.Content
comment.Content = form.Body
- if err := models.UpdateComment(comment); err != nil {
+ if err := models.UpdateComment(ctx.User, comment, oldContent); err != nil {
ctx.Error(500, "UpdateComment", err)
return
}
@@ -119,7 +120,7 @@ func DeleteIssueComment(ctx *context.APIContext) {
return
}
- if err = models.DeleteCommentByID(comment.ID); err != nil {
+ if err = models.DeleteCommentByID(ctx.User, comment.ID); err != nil {
ctx.Error(500, "DeleteCommentByID", err)
return
}