액션 노드들 로직 구현

This commit is contained in:
kjs
2025-10-02 17:51:15 +09:00
parent 37e018b33c
commit 258bd80201
13 changed files with 4504 additions and 525 deletions

View File

@@ -111,13 +111,31 @@ function FlowEditorInner() {
y: event.clientY,
});
// 🔥 노드 타입별 기본 데이터 설정
const defaultData: any = {
displayName: `${type} 노드`,
};
// 액션 노드의 경우 targetType 기본값 설정
if (["insertAction", "updateAction", "deleteAction", "upsertAction"].includes(type)) {
defaultData.targetType = "internal"; // 기본값: 내부 DB
defaultData.fieldMappings = [];
defaultData.options = {};
if (type === "updateAction" || type === "deleteAction") {
defaultData.whereConditions = [];
}
if (type === "upsertAction") {
defaultData.conflictKeys = [];
}
}
const newNode: any = {
id: `node_${Date.now()}`,
type,
position,
data: {
displayName: `${type} 노드`,
},
data: defaultData,
};
addNode(newNode);