From 09f6d39f18e8da73d7419ef65d2220b74463c8d4 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Thu, 22 Jan 2026 09:43:47 -0500 Subject: [PATCH] Simplify home phone/extension slicing --- src/store/index.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 9923c99a..2bc88be8 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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;