From b56f0b483b80dfd6fee999f57b4ed3187a3e2d8f Mon Sep 17 00:00:00 2001 From: Stephen Hand Date: Tue, 11 Oct 2022 12:17:45 +0100 Subject: [PATCH] Fix bug where 'id' was being shadowed in AddEditCaseItem save function --- plugin-hrm-form/src/components/case/AddEditCaseItem.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin-hrm-form/src/components/case/AddEditCaseItem.tsx b/plugin-hrm-form/src/components/case/AddEditCaseItem.tsx index ced64e1141..6f64e1b8f3 100644 --- a/plugin-hrm-form/src/components/case/AddEditCaseItem.tsx +++ b/plugin-hrm-form/src/components/case/AddEditCaseItem.tsx @@ -154,7 +154,7 @@ const AddEditCaseItem: React.FC = ({ } const save = async () => { - const { info, id } = connectedCase; + const { info, id: caseId } = connectedCase; const rawForm = workingCopy.form; const form = transformValues(formDefinition)(rawForm); const now = new Date().toISOString(); @@ -188,7 +188,7 @@ const AddEditCaseItem: React.FC = ({ } }); } - const updatedCase = await updateCase(id, { info: newInfo }); + const updatedCase = await updateCase(caseId, { info: newInfo }); setConnectedCase(updatedCase, task.taskSid); };