Bailing out when submit order fails
This commit is contained in:
parent
ee147e7e9e
commit
13d3bb68d7
2 changed files with 22 additions and 18 deletions
|
|
@ -303,20 +303,22 @@ export default {
|
||||||
await submitWorkOrder({
|
await submitWorkOrder({
|
||||||
pageNameToLog: 'payment-method',
|
pageNameToLog: 'payment-method',
|
||||||
submitAfterSave: true
|
submitAfterSave: true
|
||||||
|
}).then(() => {
|
||||||
|
useMainStore().resetSubmittedOrder();
|
||||||
|
|
||||||
|
this.$router.navigate(
|
||||||
|
this.navigationScenarios.CLICKED_FORWARD,
|
||||||
|
this.$route
|
||||||
|
);
|
||||||
|
}).catch((submitError) => {
|
||||||
|
useMainStore().setBailout(bailoutMessage.saveSessionError(submitError.data));
|
||||||
|
this.$router.navigate(
|
||||||
|
this.navigationScenarios.SAVE_SESSION_FAILED,
|
||||||
|
this.$route,
|
||||||
|
{ query: { issPage: issPageValues.PAYMENT_METHOD } }
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
useMainStore().resetSubmittedOrder();
|
|
||||||
|
|
||||||
this.$router.navigate(
|
|
||||||
this.navigationScenarios.CLICKED_FORWARD,
|
|
||||||
this.$route
|
|
||||||
);
|
|
||||||
} catch (error) {
|
} 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}`);
|
console.error(`error: response from submit work order:${error.message}`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -356,14 +356,16 @@ export default {
|
||||||
await submitWorkOrder({
|
await submitWorkOrder({
|
||||||
pageNameToLog: 'tpa-submit',
|
pageNameToLog: 'tpa-submit',
|
||||||
submitAfterSave: true
|
submitAfterSave: true
|
||||||
|
}).then(() => {
|
||||||
|
this.navigate(this.navigationScenarios.CLICKED_FORWARD);
|
||||||
|
}).catch((submitError) => {
|
||||||
|
useMainStore().setBailout(bailoutMessage.saveSessionError(submitError.data));
|
||||||
|
this.navigate(
|
||||||
|
this.navigationScenarios.SAVE_SESSION_FAILED,
|
||||||
|
{ query: { issPage: this.issPageValues.TPA_SUBMIT } }
|
||||||
|
);
|
||||||
});
|
});
|
||||||
this.navigate(this.navigationScenarios.CLICKED_FORWARD);
|
|
||||||
} catch (error) {
|
} 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}`);
|
console.error(`error: response from submit work order:${error.message}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue