feat: Portal and Category public APIs (#4946)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
json.name category.name
|
||||
json.slug category.slug
|
||||
json.locale category.locale
|
||||
json.description category.description
|
||||
json.position category.position
|
||||
@@ -1,5 +1,25 @@
|
||||
json.id category.id
|
||||
json.name category.name
|
||||
json.slug category.slug
|
||||
json.locale category.locale
|
||||
json.description category.description
|
||||
json.position category.position
|
||||
|
||||
json.related_categories do
|
||||
if category.related_categories.any?
|
||||
json.array! category.related_categories.each do |related_category|
|
||||
json.partial! partial: 'associated_category', category: related_category
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if category.parent_category.present?
|
||||
json.parent_category do
|
||||
json.partial! partial: 'associated_category', category: category.parent_category
|
||||
end
|
||||
end
|
||||
|
||||
if category.linked_category.present?
|
||||
json.linked_category do
|
||||
json.partial! partial: 'associated_category', category: category.linked_category
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
json.id portal.id
|
||||
json.color portal.color
|
||||
json.custom_domain portal.custom_domain
|
||||
json.header_text portal.header_text
|
||||
json.homepage_link portal.homepage_link
|
||||
json.name portal.name
|
||||
json.page_title portal.page_title
|
||||
json.slug portal.slug
|
||||
json.config portal.config
|
||||
|
||||
json.categories do
|
||||
if portal.categories.any?
|
||||
json.array! portal.categories.each do |category|
|
||||
json.partial! 'categories/category.json.jbuilder', category: category
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user