chore: Add articles metadata (#5125)
This commit is contained in:
@@ -24,4 +24,6 @@ if category.root_category.present?
|
||||
end
|
||||
end
|
||||
|
||||
json.articles_count category.articles.published.try(:count)
|
||||
json.meta do
|
||||
json.articles_count category.articles.published.size
|
||||
end
|
||||
|
||||
@@ -8,7 +8,13 @@ json.slug portal.slug
|
||||
json.categories do
|
||||
if portal.categories.any?
|
||||
json.array! portal.categories.each do |category|
|
||||
json.partial! 'categories/category.json.jbuilder', category: category
|
||||
json.partial! 'api/v1/models/category.json.jbuilder', category: category
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json.meta do
|
||||
json.articles_count portal.articles.published.size
|
||||
json.categories_count portal.categories.size
|
||||
json.default_locale portal.default_locale
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user