Chatwoot/app/controllers/api/v1/profiles_controller.rb
Pranav Raj S 160a6fc6cf
feat: Save UI state in the database (#1635)
feat: Save UI state in the database
2021-01-10 19:25:33 +05:30

30 lines
524 B
Ruby

class Api::V1::ProfilesController < Api::BaseController
before_action :set_user
def show
render partial: 'api/v1/models/user.json.jbuilder', locals: { resource: @user }
end
def update
@user.update!(profile_params)
end
private
def set_user
@user = current_user
end
def profile_params
params.require(:profile).permit(
:email,
:name,
:display_name,
:password,
:password_confirmation,
:avatar,
:availability,
ui_settings: {}
)
end
end