Chatwoot/app/controllers/api/v1/widget/contacts_controller.rb
Sojan Jose cdd385b269
feat: Custom Attributes for contacts (#1158)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-08-21 19:30:27 +05:30

15 lines
431 B
Ruby

class Api::V1::Widget::ContactsController < Api::V1::Widget::BaseController
def update
contact_identify_action = ContactIdentifyAction.new(
contact: @contact,
params: permitted_params.to_h.deep_symbolize_keys
)
render json: contact_identify_action.perform
end
private
def permitted_params
params.permit(:website_token, :identifier, :email, :name, :avatar_url, custom_attributes: {})
end
end