node pluginoutput check (#3074)
This commit is contained in:
@@ -22,7 +22,8 @@ import { EditorVariablePickerType } from '@fastgpt/web/components/common/Textare
|
||||
import {
|
||||
formatEditorVariablePickerIcon,
|
||||
getAppChatConfig,
|
||||
getGuideModule
|
||||
getGuideModule,
|
||||
isReferenceValue
|
||||
} from '@fastgpt/global/core/workflow/utils';
|
||||
import { TFunction } from 'next-i18next';
|
||||
import {
|
||||
@@ -269,6 +270,7 @@ export const checkWorkflowNodeAndConnection = ({
|
||||
nodes: Node<FlowNodeItemType, string | undefined>[];
|
||||
edges: Edge<any>[];
|
||||
}): string[] | undefined => {
|
||||
const nodeIds: string[] = nodes.map((node) => node.data.nodeId);
|
||||
// 1. reference check. Required value
|
||||
for (const node of nodes) {
|
||||
const data = node.data;
|
||||
@@ -324,6 +326,13 @@ export const checkWorkflowNodeAndConnection = ({
|
||||
if (input.value === undefined) return true;
|
||||
}
|
||||
|
||||
if (
|
||||
node.data.flowNodeType === FlowNodeTypeEnum.pluginOutput &&
|
||||
!(isReferenceValue(input.value, nodeIds) && input.value[1])
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// check reference invalid
|
||||
const renderType = input.renderTypeList[input.selectedTypeIndex || 0];
|
||||
if (renderType === FlowNodeInputTypeEnum.reference && input.required) {
|
||||
|
||||
Reference in New Issue
Block a user