fix: parse mobile_no if available
This commit is contained in:
parent
059c55ca96
commit
38ec216227
@ -38,7 +38,7 @@ export const contactsStore = defineStore('crm-contacts', () => {
|
|||||||
for (let lead_contact of lead_contacts) {
|
for (let lead_contact of lead_contacts) {
|
||||||
// remove special characters from phone number to make it easier to search
|
// remove special characters from phone number to make it easier to search
|
||||||
// also remove spaces but keep + sign at the start
|
// also remove spaces but keep + sign at the start
|
||||||
lead_contact.mobile_no = lead_contact.mobile_no.replace(/[^0-9+]/g, '')
|
lead_contact.mobile_no = lead_contact.mobile_no?.replace(/[^0-9+]/g, '')
|
||||||
lead_contact.full_name = lead_contact.lead_name
|
lead_contact.full_name = lead_contact.lead_name
|
||||||
leadContactsByPhone[lead_contact.mobile_no] = lead_contact
|
leadContactsByPhone[lead_contact.mobile_no] = lead_contact
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ export const contactsStore = defineStore('crm-contacts', () => {
|
|||||||
return contactsByName[name]
|
return contactsByName[name]
|
||||||
}
|
}
|
||||||
function getLeadContact(mobile_no) {
|
function getLeadContact(mobile_no) {
|
||||||
mobile_no = mobile_no.replace(/[^0-9+]/g, '')
|
mobile_no = mobile_no?.replace(/[^0-9+]/g, '')
|
||||||
return leadContactsByPhone[mobile_no]
|
return leadContactsByPhone[mobile_no]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user