From 45208ccf1fdfc8d7aa7d8a58af6dbe706cfd5aff Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Wed, 15 Mar 2023 11:40:50 -0400 Subject: [PATCH] CSR-1229 | Repairs save after pricing, move getSupporting to Veh-Damage --- src/layouts/estimate/estimate.vue | 21 +------------------ src/layouts/vehicle-damage/vehicle-damage.vue | 11 ++++++++++ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 15a9749e7..239bb0f26 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -252,28 +252,9 @@ export default { } else if (this.$store.getters.order.referralNumber?.length === 6) { await this.navigateForwardWithSingleCarMatch(); } else if (this.isRepair) { - const supportingItemsPromise = await this.dispatchStoreAction( - storeActions.GET_SUPPORTING_ITEMS - ); - - const promiseResultMap = [ - { - resultKey: "supportingItems", - promise: supportingItemsPromise, - }, - ]; - - const resultMap = await settleAllPromises(promiseResultMap); - - this.dispatchStoreAction( - this.storeActions.SAVE_SUPPORTING_ITEMS, - resultMap.supportingItems, - false - ); - // call saveSession here - navigateWithSaving saves too late in the flow await saveSession({}); - return this.$router.navigateWithoutSaving( + return this.$router.navigateWithSaving( this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS, this.$route ); diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 7446d4cd0..349c10fb2 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -324,6 +324,17 @@ export default { false ); + if (this.isWindshieldRepair) { + const supportingItems = await this.dispatchStoreAction( + storeActions.GET_SUPPORTING_ITEMS + ); + this.dispatchStoreAction( + this.storeActions.SAVE_SUPPORTING_ITEMS, + supportingItems.data, + false + ); + } + return this.navigateForward(); },