mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-05 16:50:38 +08:00
chore: init fetch logic
This commit is contained in:
parent
831ca8513b
commit
02110b4323
@ -12,11 +12,10 @@ const useSetWorkflowVarsWithValue = () => {
|
||||
const invalidateConversationVarValues = useInvalidateConversationVarValues(appId)
|
||||
const invalidateSysVarValues = useInvalidateSysVarValues(appId)
|
||||
|
||||
const addNodeInfo = (inspectVars: VarInInspect[]) => {
|
||||
const setInspectVarsToStore = (inspectVars: VarInInspect[]) => {
|
||||
const { getNodes } = store.getState()
|
||||
const nodeArr = getNodes()
|
||||
const nodesKeyValue: Record<string, Node> = {}
|
||||
// TODO: handle conversation, env and system variables
|
||||
nodeArr.forEach((node) => {
|
||||
nodesKeyValue[node.id] = node
|
||||
})
|
||||
@ -54,7 +53,7 @@ const useSetWorkflowVarsWithValue = () => {
|
||||
invalidateConversationVarValues()
|
||||
invalidateSysVarValues()
|
||||
const data = await fetchAllInspectVars(appId)
|
||||
addNodeInfo(data)
|
||||
setInspectVarsToStore(data)
|
||||
}
|
||||
return {
|
||||
fetchInspectVars,
|
||||
|
Loading…
x
Reference in New Issue
Block a user