Only update itac state if parts were priced

This commit is contained in:
Michaela Brydon 2024-09-11 13:00:58 -04:00
parent 2842011af6
commit 3c0b3b721d

View file

@ -1122,18 +1122,20 @@ export const useMainStore = defineStore({
throw error; throw error;
}); });
const { lineItems, serverData, isItac, primaryBillToNumber } = response.data; const { lineItems, serverData, isItac, primaryBillToNumber, partsWerePriced } = response.data;
if (serverData) { if (serverData) {
this.order.lineItems.serverData = serverData; this.order.lineItems.serverData = serverData;
} }
if (isItac) { if (partsWerePriced) {
// if the ITAC Pricing API call returns isItac = true then we should switch to ITAC coverage type if (isItac) {
this.updateCoverageType(coverageType.ITAC); // if the ITAC Pricing API call returns isItac = true then we should switch to ITAC coverage type
} else if (this.isITAC) { this.updateCoverageType(coverageType.ITAC);
// If the ITAC pricing API call returns isItac = false, and we are currently ITAC in the store then we should switch to deductible coverage type } else if (this.isITAC) {
this.updateCoverageType(coverageType.Deductible); // If the ITAC pricing API call returns isItac = false, and we are currently ITAC in the store then we should switch to deductible coverage type
this.updateCoverageType(coverageType.Deductible);
}
} }
if (primaryBillToNumber && primaryBillToNumber.length !== 0) { if (primaryBillToNumber && primaryBillToNumber.length !== 0) {