chore: Improve Helpcenter custom domains (#5456)
- Support rendering articles over frontend URL - Support rendering articles over help center URL - Support rendering help center home page in the custom domain root
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class Public::Api::V1::Portals::ArticlesController < PublicController
|
||||
before_action :ensure_custom_domain_request, only: [:show, :index]
|
||||
before_action :set_portal
|
||||
before_action :portal
|
||||
before_action :set_category
|
||||
before_action :set_article, only: [:show]
|
||||
layout 'portal'
|
||||
@@ -23,8 +23,8 @@ class Public::Api::V1::Portals::ArticlesController < PublicController
|
||||
@category = @portal.categories.find_by!(slug: params[:category_slug])
|
||||
end
|
||||
|
||||
def set_portal
|
||||
@portal = @portals.find_by!(slug: params[:slug], archived: false)
|
||||
def portal
|
||||
@portal ||= Portal.find_by!(slug: params[:slug], archived: false)
|
||||
end
|
||||
|
||||
def list_params
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Public::Api::V1::Portals::CategoriesController < PublicController
|
||||
before_action :ensure_custom_domain_request, only: [:show, :index]
|
||||
before_action :set_portal
|
||||
before_action :portal
|
||||
before_action :set_category, only: [:show]
|
||||
layout 'portal'
|
||||
|
||||
@@ -16,7 +16,7 @@ class Public::Api::V1::Portals::CategoriesController < PublicController
|
||||
@category = @portal.categories.find_by!(locale: params[:locale], slug: params[:category_slug])
|
||||
end
|
||||
|
||||
def set_portal
|
||||
@portal = @portals.find_by!(slug: params[:slug], archived: false)
|
||||
def portal
|
||||
@portal ||= Portal.find_by!(slug: params[:slug], archived: false)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
class Public::Api::V1::PortalsController < PublicController
|
||||
before_action :ensure_custom_domain_request, only: [:show]
|
||||
before_action :set_portal
|
||||
before_action :portal
|
||||
layout 'portal'
|
||||
|
||||
def show; end
|
||||
|
||||
private
|
||||
|
||||
def set_portal
|
||||
@portal = @portals.find_by!(slug: params[:slug], archived: false)
|
||||
def portal
|
||||
@portal ||= Portal.find_by!(slug: params[:slug], archived: false)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user