Skip to content

Commit

Permalink
fix: Set and Update portal's default locale (#5368)
Browse files Browse the repository at this point in the history
  • Loading branch information
tejaswinichile authored Sep 1, 2022
1 parent f4fc53b commit ee2189d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/controllers/api/v1/accounts/portals_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def permitted_params

def portal_params
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

Expand Down
2 changes: 1 addition & 1 deletion app/models/portal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def default_locale
private

def config_json_format
config['default_locale'] = 'en'
config['default_locale'] = default_locale
denied_keys = config.keys - CONFIG_JSON_KEYS
errors.add(:cofig, "in portal on #{denied_keys.join(',')} is not supported.") if denied_keys.any?
end
Expand Down

0 comments on commit ee2189d

Please sign in to comment.