PR updates

This commit is contained in:
Bill Richardson 2024-10-01 13:27:37 -04:00
parent 29c7125783
commit bc6b31c790
2 changed files with 9 additions and 5 deletions

View file

@ -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);
}

View file

@ -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),