From f8dc7f12f8873b5fff6c7ab0f5b0b5858bcb173e Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 15 Mar 2023 08:18:20 -0400 Subject: [PATCH] WIP --- .../service-location/service-location.vue | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 5c6f9cbb1..d5967f8c0 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -85,11 +85,19 @@ export default { async beforeRouteEnter(to, from, next) { // Call APIs const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); + + const getZipCodeData = baseMixin.methods.getZipCodeData(serviceZipCode); + + const lineItems = store.getters.order.lineItems; + const serviceabilityDetailsPromise = getServiceabilityDetails({ + serviceZipCode: serviceZipCode, + lineItems: lineItems, + }); + const serviceZipCode = store.getters.order.serviceLocation.zipCode; const serviceType = store.getters.damage.isRepair ? "Repair" : "Replace"; const parentAccountNumber = store.getters.payment.parentAccountNumber; const billToAccountNumber = 1; - const getZipCodeData = baseMixin.methods.getZipCodeData(serviceZipCode); const mobileFeePartPromise = getPricedMobileFeePart( serviceZipCode, @@ -108,6 +116,10 @@ export default { resultKey: "mobileFeePart", promise: mobileFeePartPromise, }, + { + resultKey: "serviceabilityDetails", + promise: serviceabilityDetailsPromise, + }, { resultKey: "zipCodeData", promise: getZipCodeData, @@ -119,7 +131,7 @@ export default { // Call the "next" function to complete the transition to this page. next((vm) => { vm.setCmsContent(resultMap.cmsContent); - vm.setData(resultMap.mobileFeePart); + vm.setData(resultMap.zipCodeData, resultMap.serviceabilityDetails, resultMap.mobileFeePart); }); }, computed: { @@ -175,13 +187,20 @@ export default { ); }, setData(zipCodeData, mobileFeePart) { - if (mobileFeePart) { - this.mobileFeePart = mobileFeePart; - } - if (zipCodeData) { this.zipContainsMilitaryBase = zipCodeData.containsMilitaryBase; } + + if (serviceabilityDetails) { + this.isGlassServiceableInShop = serviceabilityDetails.isGlassServiceableInShop; + this.isRecalibrationServiceableInShop = serviceabilityDetails.isRecalibrationServiceableInShop; + this.isGlassServiceableMobile = serviceabilityDetails.isGlassServiceableMobile; + this.isRecalibrationServiceableMobile = serviceabilityDetails.isRecalibrationServiceableMobile; + } + + if (mobileFeePart) { + this.mobileFeePart = mobileFeePart; + } }, getServiceAddressFromStore() { return store.getters.order.serviceLocation.address;