MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / handleConfirm

Function handleConfirm

packages/ui/src/views/tools/PasteJSONDialog.jsx:13–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11 const [error, setError] = useState('')
12
13 const handleConfirm = () => {
14 try {
15 const parsedJSON = JSON.parse(jsonInput)
16 if (!Array.isArray(parsedJSON)) throw new Error('Input must be an array of properties')
17 const formattedData = parsedJSON.map((item, index) => ({
18 id: index + 1,
19 property: item.property || '',
20 type: item.type || 'string',
21 description: item.description || '',
22 required: item.required || false
23 }))
24 onConfirm(formattedData)
25 setError('')
26 } catch (err) {
27 setError('Invalid JSON format. Please check your input.')
28 }
29 }
30
31 const exampleJSON = `[
32 {

Callers

nothing calls this directly

Calls 2

onConfirmFunction · 0.70
parseMethod · 0.65

Tested by

no test coverage detected