From ee147e7e9ee34a70568fb0f0e5eafb30fb0b0ee6 Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Wed, 19 Jun 2024 12:27:53 -0400 Subject: [PATCH] Bailing out when store not found --- src/layouts/payment-method/payment-method.vue | 5 +++++ src/layouts/tpa-submit/tpa-submit.vue | 6 ++++++ src/router/router-constants/routing-table.js | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 7dee7636..48da2b7e 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -312,6 +312,11 @@ export default { this.$route ); } catch (error) { + useMainStore().setBailout(bailoutMessage.saveSessionError(error.data)); + this.navigate( + this.navigationScenarios.SAVE_SESSION_FAILED, + { query: { issPage: this.issPageValues.PAYMENT_METHOD } } + ); console.error(`error: response from submit work order:${error.message}`); } } else { diff --git a/src/layouts/tpa-submit/tpa-submit.vue b/src/layouts/tpa-submit/tpa-submit.vue index c1b90917..be1721c3 100644 --- a/src/layouts/tpa-submit/tpa-submit.vue +++ b/src/layouts/tpa-submit/tpa-submit.vue @@ -136,6 +136,7 @@ import { } from '@/helpers/damage-review-content-generator.js'; import damageLocationsSelected from '@/constants/damage-locations-selected.js'; import { submitWorkOrder } from '@/helpers/order-helper.js'; +import bailoutMessage from '@/constants/bailoutMessage'; const VERIFYING_COVERAGE = 'Verifying coverage'; @@ -358,6 +359,11 @@ export default { }); this.navigate(this.navigationScenarios.CLICKED_FORWARD); } catch (error) { + useMainStore().setBailout(bailoutMessage.saveSessionError(error.data)); + this.navigate( + this.navigationScenarios.SAVE_SESSION_FAILED, + { query: { issPage: this.issPageValues.TPA_SUBMIT } } + ); console.error(`error: response from submit work order:${error.message}`); } }, diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 6a66676d..18895261 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -637,6 +637,10 @@ const routingTable = () => [ { scenario: navigationScenarios.CLICKED_PAY_NOW, destinationIssPageValue: issPageValues.PAYMENT_PAGE + }, + { + scenario: navigationScenarios.SAVE_SESSION_FAILED, + destinationIssPageValue: issPageValues.BAILOUT_PAGE } ] }, @@ -709,6 +713,10 @@ const routingTable = () => [ { scenario: navigationScenarios.CLICKED_FORWARD, destinationIssPageValue: issPageValues.TPA_CONFIRMATION + }, + { + scenario: navigationScenarios.SAVE_SESSION_FAILED, + destinationIssPageValue: issPageValues.BAILOUT_PAGE } ] },