feat: Portal and Category public APIs (#4946)

This commit is contained in:
Tejaswini Chile
2022-07-05 17:15:38 +05:30
committed by GitHub
parent ae59d0a343
commit 029209a634
18 changed files with 154 additions and 9 deletions

View File

@@ -0,0 +1,20 @@
class Public::Api::V1::Portals::CategoriesController < PublicController
before_action :set_portal
before_action :set_category, only: [:show]
def index
@categories = @portal.categories
end
def show; end
private
def set_category
@category = @portal.categories.find_by!(slug: params[:slug])
end
def set_portal
@portal = ::Portal.find_by!(slug: params[:portal_slug], archived: false)
end
end

View File

@@ -0,0 +1,11 @@
class Public::Api::V1::PortalsController < PublicController
before_action :set_portal
def show; end
private
def set_portal
@portal = ::Portal.find_by!(slug: params[:slug], archived: false)
end
end