Properly split extension from homePhone on load
This commit is contained in:
parent
d4530ca4cf
commit
36771caca3
1 changed files with 16 additions and 4 deletions
|
|
@ -1591,8 +1591,14 @@ export const useMainStore = defineStore({
|
|||
order.contactInfo.firstName = data?.customer?.firstName;
|
||||
order.contactInfo.lastName = data?.customer?.lastName;
|
||||
order.contactInfo.emailAddress = data?.customer?.emailAddress;
|
||||
order.contactInfo.homePhone = data?.customer?.homePhone;
|
||||
order.contactInfo.extension = data?.customer?.homePhone?.length > 10 ? data.customer.homePhone.slice(10) : '';
|
||||
if (data?.customer?.homePhone?.length > 10) {
|
||||
order.contactInfo.extension = data.customer.homePhone.slice(10);
|
||||
order.contactInfo.homePhone = data.customer.homePhone.slice(0, 10);
|
||||
}
|
||||
else {
|
||||
order.contactInfo.homePhone = data?.customer?.homePhone;
|
||||
order.contactInfo.extension = '';
|
||||
}
|
||||
order.contactInfo.servicePhone = data?.customer?.servicePhone;
|
||||
order.contactInfo.alternativePhone = data?.customer?.alternativePhone;
|
||||
order.contactInfo.requestTextUpdates = data?.customer?.isSmsOptIn;
|
||||
|
|
@ -1660,8 +1666,14 @@ export const useMainStore = defineStore({
|
|||
order.contactInfo.firstName = data?.customer?.firstName;
|
||||
order.contactInfo.lastName = data?.customer?.lastName;
|
||||
order.contactInfo.emailAddress = data?.customer?.emailAddress;
|
||||
order.contactInfo.homePhone = data?.customer?.homePhone;
|
||||
order.contactInfo.extension = data?.customer?.homePhone?.length > 10 ? data.customer.homePhone.slice(10) : '';
|
||||
if (data?.customer?.homePhone?.length > 10) {
|
||||
order.contactInfo.extension = data.customer.homePhone.slice(10);
|
||||
order.contactInfo.homePhone = data.customer.homePhone.slice(0, 10);
|
||||
}
|
||||
else {
|
||||
order.contactInfo.homePhone = data?.customer?.homePhone;
|
||||
order.contactInfo.extension = '';
|
||||
}
|
||||
order.contactInfo.servicePhone = data?.customer?.servicePhone;
|
||||
order.contactInfo.alternativePhone = data?.customer?.alternativePhone;
|
||||
order.contactInfo.requestTextUpdates = data?.customer?.isSmsOptIn;
|
||||
|
|
|
|||
Loading…
Reference in a new issue