feat: can input json editor

This commit is contained in:
Joel
2025-06-10 14:58:03 +08:00
parent 1c44fb77af
commit b73e64b975
5 changed files with 33 additions and 11 deletions

View File

@ -178,8 +178,11 @@ const useConfig = (id: string, payload: ToolNodeType) => {
const res = produce(inputVarValues, (draft) => {
Object.keys(inputs.tool_parameters).forEach((key: string) => {
const { type, value } = inputs.tool_parameters[key]
if (type === VarType.constant && (value === undefined || value === null))
if (type === VarType.constant && (value === undefined || value === null)) {
if(!draft.tool_parameters || !draft.tool_parameters[key])
return
draft.tool_parameters[key].value = value
}
})
})
return res