From 85ee04ab9040e868f92fb49c3a84ca3ced9ada9f Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Mon, 26 Feb 2024 14:10:40 -0500 Subject: [PATCH] PR feedback changes --- src/layouts/tpa-confirmation/tpa-confirmation.vue | 11 ++++++++--- src/store/index.js | 15 +++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/layouts/tpa-confirmation/tpa-confirmation.vue b/src/layouts/tpa-confirmation/tpa-confirmation.vue index 83776523..135d47ab 100644 --- a/src/layouts/tpa-confirmation/tpa-confirmation.vue +++ b/src/layouts/tpa-confirmation/tpa-confirmation.vue @@ -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: { diff --git a/src/store/index.js b/src/store/index.js index f3d4336d..9dd4e7ce 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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() {