INSR-523: Move late claim registration to just before order submission
This commit is contained in:
parent
3c1e87a341
commit
2690bf881a
1 changed files with 5 additions and 5 deletions
|
|
@ -37,11 +37,6 @@ export async function saveSession({ shouldAwaitSaveSessionQueue = false, submitA
|
|||
export async function submitWorkOrder({ submitType }) {
|
||||
const store = useMainStore();
|
||||
store.resetSubmittedOrder();
|
||||
await saveSession({
|
||||
shouldAwaitSaveSessionQueue: true,
|
||||
submitAfterSave: true,
|
||||
bailoutOnError: true
|
||||
});
|
||||
const shouldRegisterClaimAfterSubmission = store.isPolicyLookupSuccessful
|
||||
&& store.vehicle.policyVehicleId != null
|
||||
&& store.vehicle.policyVehicleId >= 0
|
||||
|
|
@ -51,6 +46,11 @@ export async function submitWorkOrder({ submitType }) {
|
|||
if (shouldRegisterClaimAfterSubmission) {
|
||||
await store.registerClaim();
|
||||
}
|
||||
await saveSession({
|
||||
shouldAwaitSaveSessionQueue: true,
|
||||
submitAfterSave: true,
|
||||
bailoutOnError: true
|
||||
});
|
||||
await store.createSubmittedOrder(submitType);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue