mirror of
https://github.com/langgenius/dify.git
synced 2025-11-02 11:52:58 +00:00
fix(variables): Improve getNodeUsedVars implementation details (#21987)
This commit is contained in:
parent
53c4912cbb
commit
71385d594d
@ -975,6 +975,7 @@ export const getNodeUsedVars = (node: Node): ValueSelector[] => {
|
|||||||
res = (data as IfElseNodeType).conditions?.map((c) => {
|
res = (data as IfElseNodeType).conditions?.map((c) => {
|
||||||
return c.variable_selector || []
|
return c.variable_selector || []
|
||||||
}) || []
|
}) || []
|
||||||
|
res.push(...((data as IfElseNodeType).cases || []).flatMap(c => (c.conditions || [])).map(c => c.variable_selector || []))
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case BlockEnum.Code: {
|
case BlockEnum.Code: {
|
||||||
@ -994,6 +995,9 @@ export const getNodeUsedVars = (node: Node): ValueSelector[] => {
|
|||||||
res = [payload.query_variable_selector]
|
res = [payload.query_variable_selector]
|
||||||
const varInInstructions = matchNotSystemVars([payload.instruction || ''])
|
const varInInstructions = matchNotSystemVars([payload.instruction || ''])
|
||||||
res.push(...varInInstructions)
|
res.push(...varInInstructions)
|
||||||
|
|
||||||
|
const classes = payload.classes.map(c => c.name)
|
||||||
|
res.push(...matchNotSystemVars(classes))
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case BlockEnum.HttpRequest: {
|
case BlockEnum.HttpRequest: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user