Fix the empty form issue, round 2 (#248)

This commit is contained in:
jbirddog 2023-05-10 10:58:01 -04:00 committed by GitHub
parent 4dc9204ecd
commit 1a81a73ab1

View File

@ -176,8 +176,10 @@ export default function TaskShow() {
if (disabled) { if (disabled) {
return; return;
} }
if (!formObject) { const dataToSubmit = formObject?.formData;
if (!dataToSubmit) {
navigate(`/tasks`); navigate(`/tasks`);
return;
} }
let queryParams = ''; let queryParams = '';
if (submitType === FormSubmitType.Draft) { if (submitType === FormSubmitType.Draft) {
@ -185,7 +187,6 @@ export default function TaskShow() {
} }
setDisabled(true); setDisabled(true);
removeError(); removeError();
const dataToSubmit = formObject.formData;
delete dataToSubmit.isManualTask; delete dataToSubmit.isManualTask;
HttpService.makeCallToBackend({ HttpService.makeCallToBackend({
path: `/tasks/${params.process_instance_id}/${params.task_id}${queryParams}`, path: `/tasks/${params.process_instance_id}/${params.task_id}${queryParams}`,