feat: Fetching the portal data related to a specific custom domain (#5249)

This commit is contained in:
Tejaswini Chile
2022-09-07 12:22:24 +05:30
committed by GitHub
parent 6574407636
commit db73d033b7
11 changed files with 74 additions and 35 deletions

View File

@@ -7,20 +7,20 @@ 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
json.partial! partial: 'public/api/v1/models/associated_category.json.jbuilder', category: related_category
end
end
end
if category.parent_category.present?
json.parent_category do
json.partial! partial: 'associated_category', category: category.parent_category
json.partial! partial: 'public/api/v1/models/associated_category.json.jbuilder', category: category.parent_category
end
end
if category.root_category.present?
json.root_category do
json.partial! partial: 'associated_category', category: category.root_category
json.partial! partial: 'public/api/v1/models/associated_category.json.jbuilder', category: category.root_category
end
end

View File

@@ -8,7 +8,7 @@ json.slug portal.slug
json.categories do
if portal.categories.any?
json.array! portal.categories.each do |category|
json.partial! 'api/v1/models/category.json.jbuilder', category: category
json.partial! 'public/api/v1/models/category.json.jbuilder', category: category
end
end
end