Submitting referral upon tpa confirmation page

This commit is contained in:
Michaela Brydon 2024-06-17 14:04:15 -04:00
parent f41b9afcf7
commit 5864ddcae9
2 changed files with 13 additions and 3 deletions

View file

@ -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,17 @@ export default {
onClickEdit: onClick
};
},
forwardButtonAction() {
this.navigate(this.navigationScenarios.CLICKED_FORWARD);
async forwardButtonAction() {
useMainStore().resetSubmittedOrder();
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);

View file

@ -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) {