PR feedback changes

This commit is contained in:
Katie Kroell 2024-02-26 14:10:40 -05:00
parent ca10097f40
commit 85ee04ab90
2 changed files with 17 additions and 9 deletions

View file

@ -99,13 +99,19 @@ export default {
async beforeRouteEnter(to, from, next) { async beforeRouteEnter(to, from, next) {
// Call APIs // Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage); const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
const accountInfoPromise = useMainStore().getCarrierAccountInfo();
// Settle promises and get results // Settle promises and get results
const promiseResultMap = [ const promiseResultMap = [
{ {
resultKey: 'cmsContent', resultKey: 'cmsContent',
promise: cmsContentPromise promise: cmsContentPromise
}]; },
// use resultMap to populate layout content. {
resultKey: 'accountInfo',
promise: accountInfoPromise
}
];
// use resultMap to populate layout content.
const resultMap = await settleAllPromises(promiseResultMap); const resultMap = await settleAllPromises(promiseResultMap);
next((vm) => { next((vm) => {
vm.setCmsContent(resultMap.cmsContent); vm.setCmsContent(resultMap.cmsContent);
@ -175,7 +181,6 @@ export default {
if (this.carrierUrl) { if (this.carrierUrl) {
this.$refs.siteFooter.updateButtonText(`Go back to ${this.carrierName}`); this.$refs.siteFooter.updateButtonText(`Go back to ${this.carrierName}`);
} }
useMainStore().getCarrierAccountInfo();
}, },
methods: methods:
{ {

View file

@ -926,13 +926,16 @@ export const useMainStore = defineStore({
}); });
}, },
async getCarrierAccountInfo() { getCarrierAccountInfo() {
const response = await globalMethods.callHttpClient({ return new Promise((resolve, reject) => {
method: endpoints.GetAccountInfo.method, globalMethods.callHttpClient({
endpoint: endpoints.GetAccountInfo.url + this.issConfig.parentAccountNumber method: endpoints.GetAccountInfo.method,
endpoint: endpoints.GetAccountInfo.url + this.issConfig.parentAccountNumber
}).then((response) => {
this.order.carrierPhoneNumber = response.data.phoneNumber;
return resolve(response.data);
}).catch((error) => reject(error));
}); });
this.order.carrierPhoneNumber = response.data.phoneNumber;
return response;
}, },
async getSupportingItems() { async getSupportingItems() {