Skip to content

A platform for community discussion. Free, open, simple.

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

Vinoth Kannan76696b22fe18
diff --git a/lib/post_destroyer.rb b/lib/post_destroyer.rb
index 9509a965644..cf36b72d6f9 100644
--- a/lib/post_destroyer.rb
+++ b/lib/post_destroyer.rb
@@ -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