mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-05 10:06:55 +08:00
21 lines
493 B
Ruby
21 lines
493 B
Ruby
# frozen_string_literal: true
|
|
|
|
module DiscourseTopicVoting
|
|
module WebHookExtension
|
|
extend ActiveSupport::Concern
|
|
|
|
class_methods do
|
|
def enqueue_topic_voting_hooks(event, topic, payload)
|
|
if active_web_hooks(event).exists?
|
|
WebHook.enqueue_hooks(
|
|
:topic_voting,
|
|
event,
|
|
category_id: topic.category_id,
|
|
tag_ids: topic.tags.pluck(:id),
|
|
payload: payload,
|
|
)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|