Simplify home phone/extension slicing
This commit is contained in:
parent
7965fe9137
commit
09f6d39f18
1 changed files with 4 additions and 16 deletions
|
|
@ -1591,14 +1591,8 @@ export const useMainStore = defineStore({
|
|||
order.contactInfo.firstName = data?.customer?.firstName;
|
||||
order.contactInfo.lastName = data?.customer?.lastName;
|
||||
order.contactInfo.emailAddress = data?.customer?.emailAddress;
|
||||
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.extension = data.customer.homePhone?.slice(10);
|
||||
order.contactInfo.homePhone = data.customer.homePhone?.slice(0, 10);
|
||||
order.contactInfo.servicePhone = data?.customer?.servicePhone;
|
||||
order.contactInfo.alternativePhone = data?.customer?.alternativePhone;
|
||||
order.contactInfo.requestTextUpdates = data?.customer?.isSmsOptIn;
|
||||
|
|
@ -1666,14 +1660,8 @@ export const useMainStore = defineStore({
|
|||
order.contactInfo.firstName = data?.customer?.firstName;
|
||||
order.contactInfo.lastName = data?.customer?.lastName;
|
||||
order.contactInfo.emailAddress = data?.customer?.emailAddress;
|
||||
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.extension = data.customer.homePhone?.slice(10);
|
||||
order.contactInfo.homePhone = data.customer.homePhone?.slice(0, 10);
|
||||
order.contactInfo.servicePhone = data?.customer?.servicePhone;
|
||||
order.contactInfo.alternativePhone = data?.customer?.alternativePhone;
|
||||
order.contactInfo.requestTextUpdates = data?.customer?.isSmsOptIn;
|
||||
|
|
|
|||
Loading…
Reference in a new issue