From bc6b31c7902209e6e638726a410cf88470524b16 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Tue, 1 Oct 2024 13:27:37 -0400 Subject: [PATCH] PR updates --- src/layouts/vehicle-damage/vehicle-damage.vue | 4 ++-- src/store/index.js | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 2ca0efe1..1561a3bd 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -414,8 +414,8 @@ export default { ); if (this.isWindshieldRepair) { - await useMainStore().getRecalParts(); - const supportingItems = await useMainStore().getSupportingItems(); + const results = await Promise.allSettled([useMainStore().getSupportingItems(), useMainStore().getRecalParts()]); + const supportingItems = results[0]; useMainStore().updateSupportingItems(supportingItems.data); } diff --git a/src/store/index.js b/src/store/index.js index 0aa5d4ab..d0e6f37a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1027,10 +1027,11 @@ export const useMainStore = defineStore({ const { zipCode } = this.order.serviceLocation; if (glassParts && glassParts.length > 0) { + const recalPromises = []; glassParts.forEach((glassPart) => { if (glassPart.requiresRecalibration) { const partNumberChecked = glassPart.partNumber; - globalMethods + recalPromises.push(globalMethods .callHttpClient({ method: endpoints.GetRecalParts.method, endpoint: endpoints.GetRecalParts.url( @@ -1048,9 +1049,10 @@ export const useMainStore = defineStore({ if (recalResponse && recalResponse.recalibrationParts && recalResponse.recalibrationParts.length > 0) { this.addGlassPartRecalibrationInfo(partNumberChecked, recalResponse.recalibrationParts[0]); } - }); + })); } }); + Promise.allSettled(recalPromises); } }, addGlassPartRecalibrationInfo(partNumber, recalPartInformation) { @@ -1070,6 +1072,8 @@ export const useMainStore = defineStore({ const { carId } = this.vehicle; const { isRepair, numberOfChips } = this.damage; + console.log('supporting http response..'); + return globalMethods .callHttpClient({ method: endpoints.GetSupportingItems.method, @@ -1257,7 +1261,7 @@ export const useMainStore = defineStore({ facilityType: 'Mobile', parentAccountNumber: this.order.parentAccountNumber, billToAccountNumber: this.billToAccountNumber, - isItacOptimized: false, //TODO: Implement with response from getITACPriceOrderItems + isItacOptimized: false, // TODO: Implement with response from getITACPriceOrderItems providerNumber: this.providerNumber, carId: vehicle.carId, coverageStatus: coverageStatuses.mapToApi(insuranceCoverage.coverageStatus),