fix: Full name update when creating a conversation without an email id (#5832)

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Muhsin Keloth
2022-11-15 09:09:46 +05:30
committed by GitHub
parent efceaec950
commit b5f7be0cd2
2 changed files with 26 additions and 2 deletions

View File

@@ -50,7 +50,9 @@ class Api::V1::Widget::BaseController < ApplicationController
end
def contact_name
params[:contact][:name] || contact_email.split('@')[0] if contact_email.present?
return if @contact.email.present? || @contact.phone_number.present? || @contact.identifier.present?
permitted_params.dig(:contact, :name) || (contact_email.split('@')[0] if contact_email.present?)
end
def contact_phone_number