From 3c0b3b721dea85ba4c642d05d54b976e334b9a34 Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Wed, 11 Sep 2024 13:00:58 -0400 Subject: [PATCH] Only update itac state if parts were priced --- src/store/index.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index e4519ee1..3aaedefb 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1122,18 +1122,20 @@ export const useMainStore = defineStore({ throw error; }); - const { lineItems, serverData, isItac, primaryBillToNumber } = response.data; + const { lineItems, serverData, isItac, primaryBillToNumber, partsWerePriced } = response.data; if (serverData) { this.order.lineItems.serverData = serverData; } - if (isItac) { - // if the ITAC Pricing API call returns isItac = true then we should switch to ITAC coverage type - this.updateCoverageType(coverageType.ITAC); - } else if (this.isITAC) { - // 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 (partsWerePriced) { + if (isItac) { + // if the ITAC Pricing API call returns isItac = true then we should switch to ITAC coverage type + this.updateCoverageType(coverageType.ITAC); + } else if (this.isITAC) { + // 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) {