mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 12:37:56 +00:00
fix: Set and Update portal's default locale (#5368)
This commit is contained in:
@@ -58,7 +58,8 @@ class Api::V1::Accounts::PortalsController < Api::V1::Accounts::BaseController
|
|||||||
|
|
||||||
def portal_params
|
def portal_params
|
||||||
params.require(:portal).permit(
|
params.require(:portal).permit(
|
||||||
:account_id, :color, :custom_domain, :header_text, :homepage_link, :name, :page_title, :slug, :archived, config: { allowed_locales: [] }
|
:account_id, :color, :custom_domain, :header_text, :homepage_link, :name, :page_title, :slug, :archived, { config: [:default_locale,
|
||||||
|
{ allowed_locales: [] }] }
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class Portal < ApplicationRecord
|
|||||||
private
|
private
|
||||||
|
|
||||||
def config_json_format
|
def config_json_format
|
||||||
config['default_locale'] = 'en'
|
config['default_locale'] = default_locale
|
||||||
denied_keys = config.keys - CONFIG_JSON_KEYS
|
denied_keys = config.keys - CONFIG_JSON_KEYS
|
||||||
errors.add(:cofig, "in portal on #{denied_keys.join(',')} is not supported.") if denied_keys.any?
|
errors.add(:cofig, "in portal on #{denied_keys.join(',')} is not supported.") if denied_keys.any?
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user