diff --git a/src/layouts/tpa-submit/tpa-submit.vue b/src/layouts/tpa-submit/tpa-submit.vue index c94b6598..c1b90917 100644 --- a/src/layouts/tpa-submit/tpa-submit.vue +++ b/src/layouts/tpa-submit/tpa-submit.vue @@ -135,6 +135,7 @@ import { getLocationAnswer } from '@/helpers/damage-review-content-generator.js'; import damageLocationsSelected from '@/constants/damage-locations-selected.js'; +import { submitWorkOrder } from '@/helpers/order-helper.js'; const VERIFYING_COVERAGE = 'Verifying coverage'; @@ -349,8 +350,16 @@ export default { onClickEdit: onClick }; }, - forwardButtonAction() { - this.navigate(this.navigationScenarios.CLICKED_FORWARD); + async forwardButtonAction() { + try { + await submitWorkOrder({ + pageNameToLog: 'tpa-submit', + submitAfterSave: true + }); + this.navigate(this.navigationScenarios.CLICKED_FORWARD); + } catch (error) { + console.error(`error: response from submit work order:${error.message}`); + } }, navigate(scenario) { this.$router.navigate(scenario, this.$route); diff --git a/src/router/index.js b/src/router/index.js index 25a72e96..b51c31c2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -170,7 +170,7 @@ router.afterEach(async (to, from) => { store.clearSaveSessionPromise(); } - if (to.query.issPage !== issPageValues.ORDER_CONFIRMATION) { + if (to.query.issPage !== issPageValues.TPA_CONFIRMATION && to.query.issPage !== issPageValues.ORDER_CONFIRMATION) { const saveSessionSynchronous = !!from.params[routerParams.SAVE_SESSION_SYNCHRONOUS]; await saveSession({ shouldAwaitSaveSessionQueue: saveSessionSynchronous }).catch((error) => { if (from.name === issPageValues.WELCOME_PAGE) {