From 6756c909cde945d1d2c70c9eb206b89431c86028 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 29 Nov 2022 11:23:42 -0500 Subject: [PATCH] CSR-944 small refactor --- src/helpers/heritage-integration/navigation-helper.js | 11 +---------- src/layouts/estimate/estimate.vue | 8 ++------ 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 5ac7a902e..3b1971789 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -75,16 +75,7 @@ async function getLatestPageForRedirection() { const moldingQuestionsComponent = await getLazyLoadedComponent(fmgPageValues.MOLDING_QUESTIONS); const capabilityQuestionsComponent = await getLazyLoadedComponent(fmgPageValues.CAPABILITY_QUESTIONS); - const vinOptionalVehiclePromise = store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE); - const promiseResultMap = [ - { - resultKey: "vinOptionalOptions", - promise: vinOptionalVehiclePromise, - }, - ]; - const resultMap = await settleAllPromises(promiseResultMap); - - var isVinOptionalVehicle = resultMap.vinOptionalOptions; + const isVinOptionalVehicle = await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE); if (!vehicleMakeComponent.methods.arePagePrerequisitesValid()) { return fmgPageValues.VEHICLE_YEAR; diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 8097585e6..8a09d65f9 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -143,7 +143,6 @@ export default { async beforeRouteEnter(to, from, next) { //Call APIs const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); - const vinOptionalVehiclePromise = store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE); //Settle promises and get results const promiseResultMap = [ @@ -151,16 +150,13 @@ export default { resultKey: "cmsContent", promise: cmsContentPromise, }, - { - resultKey: "vinOptionalOptions", - promise: vinOptionalVehiclePromise, - }, ]; const resultMap = await settleAllPromises(promiseResultMap); + const isVinOptionalVehicle = await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE); next((vm) => { - vm.isVinOptionalVehicle = resultMap.vinOptionalOptions; + vm.isVinOptionalVehicle = isVinOptionalVehicle; if (resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.includes("|")) { const forwardTextOption = resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.split("|");