mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Couldn't access "Uncategorized" category from category list.
This commit is contained in:
@@ -9,7 +9,8 @@ class CategoryDetailedSerializer < ApplicationSerializer
|
||||
:topics_week,
|
||||
:topics_month,
|
||||
:topics_year,
|
||||
:description
|
||||
:description,
|
||||
:is_uncategorized
|
||||
|
||||
has_many :featured_users, serializer: BasicUserSerializer
|
||||
has_many :featured_topics, serializer: CategoryTopicSerializer, embed: :objects, key: :topics
|
||||
@@ -26,4 +27,12 @@ class CategoryDetailedSerializer < ApplicationSerializer
|
||||
object.topics_year || 0
|
||||
end
|
||||
|
||||
def is_uncategorized
|
||||
name == SiteSetting.uncategorized_name
|
||||
end
|
||||
|
||||
def include_is_uncategorized?
|
||||
is_uncategorized
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -2,7 +2,8 @@ class SiteSerializer < ApplicationSerializer
|
||||
|
||||
attributes :default_archetype,
|
||||
:notification_types,
|
||||
:post_types
|
||||
:post_types,
|
||||
:uncategorized_slug
|
||||
|
||||
has_many :categories, serializer: BasicCategorySerializer, embed: :objects
|
||||
has_many :post_action_types, embed: :objects
|
||||
@@ -18,4 +19,8 @@ class SiteSerializer < ApplicationSerializer
|
||||
Post.types
|
||||
end
|
||||
|
||||
def uncategorized_slug
|
||||
Slug.for(SiteSetting.uncategorized_name)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user