Merge pull request #754 from Safelite/bug/brydon/SSR-1325.2

Submitting referral upon tpa confirmation page
This commit is contained in:
michaela-brydon-safelite 2024-06-17 15:51:32 -04:00 committed by GitHub
commit cce07e48d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View file

@ -135,6 +135,7 @@ import {
getLocationAnswer getLocationAnswer
} from '@/helpers/damage-review-content-generator.js'; } from '@/helpers/damage-review-content-generator.js';
import damageLocationsSelected from '@/constants/damage-locations-selected.js'; import damageLocationsSelected from '@/constants/damage-locations-selected.js';
import { submitWorkOrder } from '@/helpers/order-helper.js';
const VERIFYING_COVERAGE = 'Verifying coverage'; const VERIFYING_COVERAGE = 'Verifying coverage';
@ -349,8 +350,16 @@ export default {
onClickEdit: onClick onClickEdit: onClick
}; };
}, },
forwardButtonAction() { async forwardButtonAction() {
this.navigate(this.navigationScenarios.CLICKED_FORWARD); 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) { navigate(scenario) {
this.$router.navigate(scenario, this.$route); this.$router.navigate(scenario, this.$route);

View file

@ -170,7 +170,7 @@ router.afterEach(async (to, from) => {
store.clearSaveSessionPromise(); 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]; const saveSessionSynchronous = !!from.params[routerParams.SAVE_SESSION_SYNCHRONOUS];
await saveSession({ shouldAwaitSaveSessionQueue: saveSessionSynchronous }).catch((error) => { await saveSession({ shouldAwaitSaveSessionQueue: saveSessionSynchronous }).catch((error) => {
if (from.name === issPageValues.WELCOME_PAGE) { if (from.name === issPageValues.WELCOME_PAGE) {