Move webhook codes from service to webhook notification (#8712)

* Move webhook codes from service to webhook notification

* move deletecomment webhook to notifications

* fix notification
This commit is contained in:
Lunny Xiao 2019-10-30 18:02:46 +08:00 committed by Lauris BH
parent f694bb45d7
commit ac6accef09
5 changed files with 94 additions and 83 deletions

View file

@ -74,6 +74,11 @@ func (r *indexerNotifier) NotifyUpdateComment(doer *models.User, c *models.Comme
func (r *indexerNotifier) NotifyDeleteComment(doer *models.User, comment *models.Comment) {
if comment.Type == models.CommentTypeComment {
if err := comment.LoadIssue(); err != nil {
log.Error("LoadIssue: %v", err)
return
}
var found bool
if comment.Issue.Comments != nil {
for i := 0; i < len(comment.Issue.Comments); i++ {