diff --git a/projects/app/src/components/core/workflow/Flow/nodes/NodeVariableUpdate.tsx b/projects/app/src/components/core/workflow/Flow/nodes/NodeVariableUpdate.tsx index 88b199766..0a56a9318 100644 --- a/projects/app/src/components/core/workflow/Flow/nodes/NodeVariableUpdate.tsx +++ b/projects/app/src/components/core/workflow/Flow/nodes/NodeVariableUpdate.tsx @@ -95,14 +95,24 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps) => })(); const renderTypeData = menuList.find((item) => item.renderType === updateItem.renderType); - const handleUpdate = (newValue: any) => { - onUpdateList( - updateList.map((update, i) => (i === index ? { ...update, value: newValue } : update)) - ); + const handleUpdate = (newValue: ReferenceValueProps | string) => { + if (Array.isArray(newValue)) { + onUpdateList( + updateList.map((update, i) => + i === index ? { ...update, value: newValue } : update + ) + ); + } else { + onUpdateList( + updateList.map((update, i) => + i === index ? { ...update, value: ['', newValue] } : update + ) + ); + } }; return ( - + {t('core.workflow.variable')} ) => )} - + {t('core.workflow.value')}