diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx index 3fcd6eca1f..2359cb0690 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx @@ -89,8 +89,8 @@ const EditCard: FC = ({ emit('propertyNameChange', { path, parentPath, oldFields: fields, fields: currentFields }) }, [fields, currentFields, path, parentPath, emit]) - const emitPropertyTypeChange = useCallback(() => { - emit('propertyTypeChange', { path, parentPath, oldFields: fields, fields: currentFields }) + const emitPropertyTypeChange = useCallback((type: Type | ArrayType) => { + emit('propertyTypeChange', { path, parentPath, oldFields: fields, fields: { ...currentFields, type } }) }, [fields, currentFields, path, parentPath, emit]) const emitPropertyRequiredToggle = useCallback(() => { @@ -125,7 +125,7 @@ const EditCard: FC = ({ const handleTypeChange = useCallback((item: TypeItem) => { setCurrentFields(prev => ({ ...prev, type: item.value })) if (isAdvancedEditing) return - emitPropertyTypeChange() + emitPropertyTypeChange(item.value) }, [isAdvancedEditing, emitPropertyTypeChange]) const toggleRequired = useCallback(() => { @@ -189,14 +189,14 @@ const EditCard: FC = ({ }) return ( -
+
-
+
= ({ /> { currentFields.required && ( -
+
{t('workflow.nodes.llm.jsonSchema.required')}
) @@ -241,7 +241,7 @@ const EditCard: FC = ({