redirect to current step when resetting process instance

This commit is contained in:
Elizabeth Esswein 2022-12-30 10:40:34 -05:00
parent d0751235b9
commit 7fde6117f1
1 changed files with 6 additions and 3 deletions

View File

@ -262,10 +262,14 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
return spiffStepLink(<CaretRight />, 1);
};
const returnToLastSpiffStep = () => {
window.location.href = `/admin/process-instances/${params.process_model_id}/${params.process_instance_id}`;
};
const resetProcessInstance = () => {
HttpService.makeCallToBackend({
path: `${targetUris.processInstanceResetPath}/${currentSpiffStep()}`,
successCallback: refreshPage,
successCallback: returnToLastSpiffStep,
httpMethod: 'POST',
});
};
@ -637,8 +641,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
HttpService.makeCallToBackend({
path: `/task-complete/${modifiedProcessModelId}/${params.process_instance_id}/${taskToUse.id}`,
httpMethod: 'POST',
successCallback: saveTaskDataResult,
failureCallback: saveTaskDataFailure,
successCallback: returnToLastSpiffStep,
postBody: { execute },
});
};