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

DEV: call ‘enqueue_hooks’ method only if active webhooks exist

diff --git a/lib/post_destroyer.rb b/lib/post_destroyer.rb
index 9509a96..cf36b72 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

GitHub sha: 76696b22

Does this need to be tested?

Yes. It’s done here.

Awesome thanks!