From 43933480b561ffde30446bca46293004c6b19a8e Mon Sep 17 00:00:00 2001 From: CarlNation Date: Fri, 3 Jan 2025 13:44:56 -0500 Subject: [PATCH] CASH-60 CASH-60 remove the async await from the payment page prereqs. Causes a promise to be returned instead of a bool. Moved it to the router instead --- src/layouts/payment/payment.spec.js | 3 +++ src/layouts/payment/payment.vue | 5 ++--- src/router/index.js | 6 ++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/layouts/payment/payment.spec.js b/src/layouts/payment/payment.spec.js index 4290a97d4..7bc14f229 100644 --- a/src/layouts/payment/payment.spec.js +++ b/src/layouts/payment/payment.spec.js @@ -202,6 +202,9 @@ describe("payment.vue", () => { jobMaxMinutes: "45", }, }, + applicationUser: { + loggingOption: false, + }, policy: { currentDeductible: 1, }, diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 30bbb9731..750e54302 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -483,7 +483,7 @@ export default { }, }, methods: { - async arePagePrerequisitesValid() { + arePagePrerequisitesValid() { // Service Location const serviceLocation = store.getters.order.serviceLocation; const mobileReqs = !!( @@ -579,8 +579,7 @@ export default { } if (!preReqResult) { - await store.getters.applicationUser.saveSessionPromise; - this.backButtonAction(); + return false; } return preReqResult; diff --git a/src/router/index.js b/src/router/index.js index 22e5da6b1..7f5fcbf80 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -194,6 +194,12 @@ const routes = [ if (!arePagePrerequisitesValid(component)) { console.log("Page prereq error: " + component.default.name); + + if (to.query.fmgPage === fmgPageValues.PAYMENT) { + await store.getters.applicationUser.saveSessionPromise; + window.location = applicationConfig.PIA_CANCEL_URL; + } + GoToFunnelStartOn404(next); }