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

Function fetchList

packages/ui/src/ui-component/dropdown/AsyncDropdown.jsx:31–61  ·  view source on GitHub ↗
({ name, nodeData, previousNodes, currentNode })

Source from the content-addressed store, hash-verified

29})
30
31const fetchList = async ({ name, nodeData, previousNodes, currentNode }) => {
32 const selectedParam = nodeData.inputParams.find((param) => param.name === name)
33 const loadMethod = selectedParam?.loadMethod
34
35 let credentialId = nodeData.credential
36 if (!credentialId && (nodeData.inputs?.credential || nodeData.inputs?.['FLOWISE_CREDENTIAL_ID'])) {
37 credentialId = nodeData.inputs.credential || nodeData.inputs?.['FLOWISE_CREDENTIAL_ID']
38 }
39
40 let config = {
41 headers: {
42 'x-request-from': 'internal',
43 'Content-type': 'application/json'
44 },
45 withCredentials: true
46 }
47
48 let lists = await axios
49 .post(
50 `${baseURL}/api/v1/node-load-method/${nodeData.name}`,
51 { ...nodeData, loadMethod, previousNodes, currentNode, credential: credentialId },
52 config
53 )
54 .then(async function (response) {
55 return response.data
56 })
57 .catch(function (error) {
58 console.error(error)
59 })
60 return lists
61}
62
63export const AsyncDropdown = ({
64 name,

Callers 1

fetchDataFunction · 0.85

Calls 1

catchMethod · 0.45

Tested by

no test coverage detected