mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FEATURE: Add category_id to TopicViewWordpressSerializer (#10372)
This commit is contained in:
parent
8850f51fd0
commit
f78792c779
@ -4,6 +4,7 @@ class TopicViewWordpressSerializer < ApplicationSerializer
|
|||||||
|
|
||||||
# These attributes will be delegated to the topic
|
# These attributes will be delegated to the topic
|
||||||
attributes :id,
|
attributes :id,
|
||||||
|
:category_id,
|
||||||
:posts_count,
|
:posts_count,
|
||||||
:filtered_posts_count,
|
:filtered_posts_count,
|
||||||
:posts
|
:posts
|
||||||
@ -15,6 +16,10 @@ class TopicViewWordpressSerializer < ApplicationSerializer
|
|||||||
object.topic.id
|
object.topic.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def category_id
|
||||||
|
object.topic.category_id
|
||||||
|
end
|
||||||
|
|
||||||
def posts_count
|
def posts_count
|
||||||
object.topic.posts_count
|
object.topic.posts_count
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user