mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
feat: Fetching the portal data related to a specific custom domain (#5249)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
class Public::Api::V1::Portals::ArticlesController < ApplicationController
|
||||
class Public::Api::V1::Portals::ArticlesController < PublicController
|
||||
before_action :ensure_custom_domain_request, only: [:show, :index]
|
||||
before_action :set_portal
|
||||
before_action :set_category
|
||||
before_action :set_article, only: [:show]
|
||||
|
||||
def index
|
||||
@@ -12,11 +14,15 @@ class Public::Api::V1::Portals::ArticlesController < ApplicationController
|
||||
private
|
||||
|
||||
def set_article
|
||||
@article = @portal.articles.find(params[:id])
|
||||
@article = @category.articles.find(params[:id])
|
||||
end
|
||||
|
||||
def set_category
|
||||
@category = @portal.categories.find_by!(slug: params[:category_slug])
|
||||
end
|
||||
|
||||
def set_portal
|
||||
@portal = ::Portal.find_by!(slug: params[:portal_slug], archived: false)
|
||||
@portal = @portals.find_by!(slug: params[:slug], archived: false)
|
||||
end
|
||||
|
||||
def list_params
|
||||
|
||||
Reference in New Issue
Block a user