DEV: call 'enqueue_hooks' method only if active webhooks exist

This commit is contained in:
Vinoth Kannan 2019-02-19 12:47:57 +05:30
parent 27e7f2bee0
commit 76696b22fe

View File

@ -65,7 +65,7 @@ class PostDestroyer
id: @post.id,
category_id: @post&.topic&.category_id,
payload: payload
)
) if WebHook.active_web_hooks(:post).exists?
if @post.is_first_post? && @post.topic
DiscourseEvent.trigger(:topic_destroyed, @post.topic, @user)
@ -73,7 +73,7 @@ class PostDestroyer
id: topic.id,
category_id: topic&.category_id,
payload: topic_payload
)
) if WebHook.active_web_hooks(:topic).exists?
end
end