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

View file

@ -926,13 +926,16 @@ export const useMainStore = defineStore({
});
},
async getCarrierAccountInfo() {
const response = await globalMethods.callHttpClient({
method: endpoints.GetAccountInfo.method,
endpoint: endpoints.GetAccountInfo.url + this.issConfig.parentAccountNumber
getCarrierAccountInfo() {
return new Promise((resolve, reject) => {
globalMethods.callHttpClient({
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() {