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