A platform for community discussion. Free, open, simple.
Add category id to webhook post serializer
Robin Ward0a492829ea47
diff --git a/app/serializers/web_hook_post_serializer.rb b/app/serializers/web_hook_post_serializer.rbindex 4c5176c7f98..731e6ed5bed 100644--- a/app/serializers/web_hook_post_serializer.rb+++ b/app/serializers/web_hook_post_serializer.rb@@ -15,6 +15,10 @@ class WebHookPostSerializer < PostSerializertrueend+ def include_category_id?+ true+ end+%i{can_viewcan_editdiff --git a/spec/serializers/web_hook_post_serializer_spec.rb b/spec/serializers/web_hook_post_serializer_spec.rbindex 436631105cf..cc1f93c6301 100644--- a/spec/serializers/web_hook_post_serializer_spec.rb+++ b/spec/serializers/web_hook_post_serializer_spec.rb@@ -12,7 +12,7 @@ RSpec.describe WebHookPostSerializer doit 'should only include the required keys' docount = serialized_for_user(admin).keys.count- difference = count - 41+ difference = count - 42expect(difference).to eq(0), lambda {message = +""@@ -27,6 +27,10 @@ RSpec.describe WebHookPostSerializer do}end+ it "includes category_id" do+ expect(serialized_for_user(admin)[:category_id]).to eq(post.topic.category_id)+ end+it 'should only include deleted topic title for staffs' dotopic = post.topicPostDestroyer.new(Discourse.system_user, post).destroy