mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 22:21:55 +08:00
FEATURE: Added Category Experts unapproved post WebHook Event (#28802)
This PR is adding a Category Experts unapproved WebHook event type.
This commit is contained in:
parent
a7db66e8ab
commit
aacd354de5
|
@ -41,6 +41,7 @@ class WebHook < ActiveRecord::Base
|
|||
WebHookEventType::TYPES[:post_destroyed],
|
||||
WebHookEventType::TYPES[:post_recovered],
|
||||
WebHookEventType::TYPES[:category_experts_approved],
|
||||
WebHookEventType::TYPES[:category_experts_unapproved],
|
||||
],
|
||||
)
|
||||
end
|
||||
|
|
|
@ -86,6 +86,7 @@ class WebHookEventType < ActiveRecord::Base
|
|||
chat_message_trashed: 1803,
|
||||
chat_message_restored: 1804,
|
||||
category_experts_approved: 1901,
|
||||
category_experts_unapproved: 1902,
|
||||
}
|
||||
|
||||
has_and_belongs_to_many :web_hooks
|
||||
|
@ -118,7 +119,9 @@ class WebHookEventType < ActiveRecord::Base
|
|||
)
|
||||
end
|
||||
unless defined?(SiteSetting.enable_category_experts) && SiteSetting.enable_category_experts
|
||||
ids_to_exclude.concat([TYPES[:category_experts_approved]])
|
||||
ids_to_exclude.concat(
|
||||
[TYPES[:category_experts_approved], TYPES[:category_experts_unapproved]],
|
||||
)
|
||||
end
|
||||
self.where.not(id: ids_to_exclude)
|
||||
end
|
||||
|
|
|
@ -5411,6 +5411,7 @@ en:
|
|||
post_destroyed: "Post is deleted"
|
||||
post_recovered: "Post is recovered"
|
||||
category_experts_approved: "Post marked as category experts post"
|
||||
category_experts_unapproved: "Post unmarked as category experts post"
|
||||
group_event:
|
||||
group_name: "Group Events"
|
||||
group_created: "Group is created"
|
||||
|
|
|
@ -235,3 +235,8 @@ WebHookEventType.seed do |b|
|
|||
b.name = "category_experts_approved"
|
||||
b.group = WebHookEventType.groups[:post]
|
||||
end
|
||||
WebHookEventType.seed do |b|
|
||||
b.id = WebHookEventType::TYPES[:category_experts_unapproved]
|
||||
b.name = "category_experts_unapproved"
|
||||
b.group = WebHookEventType.groups[:post]
|
||||
end
|
||||
|
|
|
@ -64,6 +64,7 @@ RSpec.describe WebHookEventType do
|
|||
chat_message_trashed
|
||||
chat_message_restored
|
||||
category_experts_approved
|
||||
category_experts_unapproved
|
||||
],
|
||||
)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user