Chatwoot/app/controllers/api/v1/profiles_controller.rb
Pranav Raj S c4e2a84f65
Feature: Agent Profile Update with avatar (#449)
* Feature: Agent Profile Update with avatar
* Add Update Profile with name, avatar, email and password
2020-02-16 17:20:38 +05:30

21 lines
362 B
Ruby

class Api::V1::ProfilesController < Api::BaseController
before_action :set_user
def show
render json: @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, :password, :password_confirmation, :avatar)
end
end