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,12 +99,18 @@ 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
}]; },
{
resultKey: 'accountInfo',
promise: accountInfoPromise
}
];
// use resultMap to populate layout content. // use resultMap to populate layout content.
const resultMap = await settleAllPromises(promiseResultMap); const resultMap = await settleAllPromises(promiseResultMap);
next((vm) => { next((vm) => {
@ -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) => {
globalMethods.callHttpClient({
method: endpoints.GetAccountInfo.method, method: endpoints.GetAccountInfo.method,
endpoint: endpoints.GetAccountInfo.url + this.issConfig.parentAccountNumber endpoint: endpoints.GetAccountInfo.url + this.issConfig.parentAccountNumber
}); }).then((response) => {
this.order.carrierPhoneNumber = response.data.phoneNumber; this.order.carrierPhoneNumber = response.data.phoneNumber;
return response; return resolve(response.data);
}).catch((error) => reject(error));
});
}, },
async getSupportingItems() { async getSupportingItems() {