do not call pricing or deductible methods if unverified

This commit is contained in:
Katie Kroell 2023-11-16 16:55:44 -05:00
parent ddd27d35f5
commit e1a99064c3

View file

@ -147,7 +147,6 @@ export default {
// Call APIs
const cmsContentPromise = fetchCmsContentForPage(to?.query?.issPage);
const supportingItemsPromise = await useMainStore().getSupportingItems();
const finalDeductiblePromise = await useMainStore().getFinalDeductible();
// Settle promises and get results
const promiseResultMap = [
@ -158,10 +157,6 @@ export default {
{
resultKey: 'supportingItems',
promise: supportingItemsPromise
},
{
resultKey: 'finalDeductible',
promise: finalDeductiblePromise
}
];
@ -174,7 +169,11 @@ export default {
...(clonedGlassParts ?? [])
];
const pricingResults = await useMainStore().getPriceOrderItems(availableLineItems);
let pricingResults = [];
if (useMainStore().order.policy.policyLookupSuccessful) {
pricingResults = await useMainStore().getPriceOrderItems(availableLineItems);
await useMainStore().getFinalDeductible();
}
// Call the "next" function to complete the transition to this page.
next((vm) => {