fix(web): 修复变量校验没有包含入参
This commit is contained in:
@@ -68,7 +68,7 @@ export const nodeTypeNotFound = () => new CheckError(302, '节点类型不存在
|
||||
export const nodeError = (nodeId: string, reason?: string) => new CheckError(303, reason ?? `节点配置存在错误:${nodeId}`)
|
||||
|
||||
// @ts-ignore
|
||||
export const checkSave: (nodes: Node[], edges: Edge[], data: any) => void = (nodes, edges, data) => {
|
||||
export const checkSave: (inputSchema: Record<string, Record<string, any>>, nodes: Node[], edges: Edge[], data: any) => void = (inputSchema, nodes, edges, data) => {
|
||||
if (isEmpty(nodes)) {
|
||||
throw atLeastOneNode()
|
||||
}
|
||||
@@ -85,7 +85,7 @@ export const checkSave: (nodes: Node[], edges: Edge[], data: any) => void = (nod
|
||||
let nodeType = node.type!
|
||||
let nodeDefine = NodeRegistry[nodeType]
|
||||
for (let checker of nodeDefine.checkers) {
|
||||
let checkResult = checker(nodeId, nodes, edges, data)
|
||||
let checkResult = checker(nodeId, inputSchema, nodes, edges, data)
|
||||
if (checkResult.error) {
|
||||
throw nodeError(nodeId, checkResult.message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user