move method call to beforeRouteEnter

This commit is contained in:
Katie Kroell 2023-10-19 09:06:00 -04:00
parent 87bd8e7259
commit 790db50814

View file

@ -147,6 +147,7 @@ export default {
// Call APIs // Call APIs
const cmsContentPromise = fetchCmsContentForPage(to?.query?.issPage); const cmsContentPromise = fetchCmsContentForPage(to?.query?.issPage);
const supportingItemsPromise = await useMainStore().getSupportingItems(); const supportingItemsPromise = await useMainStore().getSupportingItems();
const finalDeductiblePromise = await useMainStore().getFinalDeductible();
// Settle promises and get results // Settle promises and get results
const promiseResultMap = [ const promiseResultMap = [
@ -157,6 +158,10 @@ export default {
{ {
resultKey: 'supportingItems', resultKey: 'supportingItems',
promise: supportingItemsPromise promise: supportingItemsPromise
},
{
resultKey: 'finalDeductible',
promise: finalDeductiblePromise
} }
]; ];
@ -328,9 +333,6 @@ export default {
} }
} }
}, },
beforeMount() {
this.getVehicleDeductible();
},
mounted() { mounted() {
setupModalLinks(this); setupModalLinks(this);
}, },
@ -453,9 +455,6 @@ export default {
}, },
setSupportingItems(newSupportingItems) { setSupportingItems(newSupportingItems) {
this.supportingItems = newSupportingItems; this.supportingItems = newSupportingItems;
},
async getVehicleDeductible() {
await useMainStore().getFinalDeductible();
} }
} }
}; };