# Evento webhook Post Distrutto

**URL:** <https://meta.discourse.org/t/post-destroyed-webhook-event/110259>\
**Category:** Product Support\
**Created:** [27 Febbraio 2019, 5:40pm UTC](https://meta.discourse.org/t/post-destroyed-webhook-event/110259 "2019-02-27T17:40:01Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![thisnthat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thisnthat/32/164804_2.png) [@thisnthat](https://meta.discourse.org/u/thisnthat)\
**Post date:** [3 Marzo 2019, 6:48pm UTC](https://meta.discourse.org/t/post-destroyed-webhook-event/110259/8 "2019-03-03T18:48:21Z")

</div>

I was able to track down the cause of this issue. The webhook I am using depends on a specific tag.

The issue appears to be in lib/post\_destroyer.rb. tag\_ids is not set on delete webhook events like it is when going through enqueue\_post\_hooks on the WebHook class. After making the following change, my destroy events started working correctly.

I replaced

```plaintext
    WebHook.enqueue_hooks(:post, :post_destroyed,
      id: @post.id,
      category_id: @post&.topic&.category_id,
      payload: payload
    ) if WebHook.active_web_hooks(:post).exists?

```

with

```plaintext
    WebHook.enqueue_hooks(:post, :post_destroyed,
      id: @post.id,
      category_id: @post&.topic&.category_id,
      tag_ids: @post&.topic&.tags&.pluck(:id),
      payload: payload
    ) if WebHook.active_web_hooks(:post).exists?

```

---

_[View the full topic](https://meta.discourse.org/t/post-destroyed-webhook-event/110259)._
