DEV: Enhance post action handler events (#23027)

This commit is contained in:
Angus McLeod
2023-08-09 19:55:00 +02:00
committed by GitHub
parent 993ed10cf0
commit 6801cf34cc
4 changed files with 55 additions and 2 deletions

View File

@@ -54,6 +54,13 @@ class PostActionDestroyer
GivenDailyLike.decrement_for(@destroyed_by.id)
end
case @post_action_type_id
when *PostActionType.notify_flag_type_ids
DiscourseEvent.trigger(:flag_destroyed, post_action, self)
when PostActionType.types[:like]
DiscourseEvent.trigger(:like_destroyed, post_action, self)
end
UserActionManager.post_action_destroyed(post_action)
PostActionNotifier.post_action_deleted(post_action)
result.success = true