MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / onCustomDataChange

Function onCustomDataChange

packages/ui/src/views/agentflowsv2/ConfigInput.jsx:40–69  ·  view source on GitHub ↗
({ inputParam, newValue })

Source from the content-addressed store, hash-verified

38 }
39
40 const onCustomDataChange = ({ inputParam, newValue }) => {
41 let nodeData = cloneDeep(selectedComponentNodeData)
42
43 const updatedInputs = { ...nodeData.inputs }
44 updatedInputs[inputParam.name] = newValue
45
46 const updatedInputParams = showHideInputParams({
47 ...nodeData,
48 inputs: updatedInputs
49 })
50
51 // Remove inputs with display set to false
52 Object.keys(updatedInputs).forEach((key) => {
53 const input = updatedInputParams.find((param) => param.name === key)
54 if (input && input.display === false) {
55 delete updatedInputs[key]
56 }
57 })
58
59 const credential = updatedInputs.credential || updatedInputs[FLOWISE_CREDENTIAL_ID]
60
61 nodeData = {
62 ...nodeData,
63 inputParams: updatedInputParams,
64 inputs: updatedInputs,
65 credential: credential ? credential : undefined
66 }
67
68 setSelectedComponentNodeData(nodeData)
69 }
70
71 // Memoize current input values for reliable comparison
72 const currentInputValues = useMemo(

Callers 1

handleDataChangeFunction · 0.50

Calls 1

showHideInputParamsFunction · 0.90

Tested by

no test coverage detected