fix: Set account default language in account API (#5086)

This commit is contained in:
Tejaswini Chile
2022-07-26 22:42:20 +05:30
committed by GitHub
parent 699b01c1d1
commit f6891aebbb
9 changed files with 26 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
class AccountBuilder
include CustomExceptions::Account
pattr_initialize [:account_name!, :email!, :confirmed, :user, :user_full_name, :user_password, :super_admin]
pattr_initialize [:account_name!, :email!, :confirmed, :user, :user_full_name, :user_password, :super_admin, :locale]
def perform
if @user.nil?

View File

@@ -19,6 +19,7 @@ class Api::V1::AccountsController < Api::BaseController
user_full_name: account_params[:user_full_name],
email: account_params[:email],
user_password: account_params[:password],
locale: account_params[:locale],
user: current_user
).perform
if @user

View File

@@ -27,6 +27,6 @@ class Platform::Api::V1::AccountsController < PlatformController
end
def account_params
params.permit(:name)
params.permit(:name, :locale)
end
end

View File

@@ -18,6 +18,7 @@ json.data do
json.name account_user.account.name
json.active_at account_user.active_at
json.role account_user.role
json.locale account_user.account.locale
end
end
end