diff options
author | Unknwon <u@gogs.io> | 2017-03-09 04:11:23 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-09 04:11:23 -0500 |
commit | 89cc6aa430c65b87808ee4a159e0a80785b51935 (patch) | |
tree | 20ac897b69822337a02796ec7a8d9951bd0c285d /routers/api/v1/repo/issue_comment.go | |
parent | c93731339f3da01bb1158acc7acf781f0dfe2468 (diff) |
webhook: add issue comment event
Diffstat (limited to 'routers/api/v1/repo/issue_comment.go')
-rw-r--r-- | routers/api/v1/repo/issue_comment.go | 5 |
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 } |