mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 13:35:20 -05:00
UX: Show category badge on enqueued posts
This commit is contained in:
@@ -9,9 +9,19 @@ class QueuedPostSerializer < ApplicationSerializer
|
||||
:rejected_by_id,
|
||||
:raw,
|
||||
:post_options,
|
||||
:created_at
|
||||
:created_at,
|
||||
:category_id
|
||||
|
||||
has_one :user, serializer: BasicUserSerializer, embed: :object
|
||||
has_one :topic, serializer: BasicTopicSerializer
|
||||
|
||||
def category_id
|
||||
cat_id = object.topic.try(:category_id) || object.post_options['category']
|
||||
cat_id.to_i if cat_id
|
||||
end
|
||||
|
||||
def include_category_id?
|
||||
category_id.present?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user