fix: Revert changes to fix name updation from pre-chat form (#4741)
This commit is contained in:
@@ -54,6 +54,7 @@ class Api::V1::Widget::BaseController < ApplicationController
|
||||
).perform
|
||||
else
|
||||
@contact.update!(email: email)
|
||||
update_contact_name
|
||||
end
|
||||
end
|
||||
|
||||
@@ -67,9 +68,14 @@ class Api::V1::Widget::BaseController < ApplicationController
|
||||
).perform
|
||||
else
|
||||
@contact.update!(phone_number: phone_number)
|
||||
update_contact_name
|
||||
end
|
||||
end
|
||||
|
||||
def update_contact_name
|
||||
@contact.update!(name: contact_name) if contact_name.present?
|
||||
end
|
||||
|
||||
def contact_email
|
||||
permitted_params.dig(:contact, :email)&.downcase
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user