setting 제거 및 불필요한 필드 제거
This commit is contained in:
parent
104faf487c
commit
ce3fea82ee
|
|
@ -110,7 +110,6 @@ export const DataFlowDesigner: React.FC<DataFlowDesignerProps> = ({
|
|||
toColumns: Array.isArray(rel.toColumns) ? rel.toColumns : [],
|
||||
connectionType: rel.connectionType || "simple-key",
|
||||
relationshipName: rel.relationshipName || "",
|
||||
settings: rel.settings || {},
|
||||
}));
|
||||
|
||||
setTempRelationships(loadedRelationships);
|
||||
|
|
@ -601,7 +600,7 @@ export const DataFlowDesigner: React.FC<DataFlowDesignerProps> = ({
|
|||
// 연결된 테이블 목록 추출
|
||||
const tableNames = extractTableNames(nodes);
|
||||
|
||||
// 관계 데이터를 JsonRelationship 형태로 변환
|
||||
// 관계 데이터를 JsonRelationship 형태로 변환 (settings 제거 - relationships는 순수 연결 정보만)
|
||||
const jsonRelationships: JsonRelationship[] = tempRelationships.map((rel) => ({
|
||||
id: rel.id,
|
||||
relationshipName: rel.relationshipName, // 🔥 핵심: 관계 이름 포함
|
||||
|
|
@ -610,7 +609,6 @@ export const DataFlowDesigner: React.FC<DataFlowDesignerProps> = ({
|
|||
fromColumns: rel.fromColumns,
|
||||
toColumns: rel.toColumns,
|
||||
connectionType: rel.connectionType,
|
||||
settings: rel.settings,
|
||||
}));
|
||||
|
||||
// 저장 요청 데이터 구성
|
||||
|
|
@ -640,14 +638,27 @@ export const DataFlowDesigner: React.FC<DataFlowDesignerProps> = ({
|
|||
: undefined,
|
||||
})),
|
||||
})),
|
||||
// 데이터 저장 액션이 있는 경우 추가
|
||||
// 데이터 저장 액션이 있는 경우 추가 (transformFunction 제거)
|
||||
plan: tempRelationships
|
||||
.filter((rel) => rel.settings?.actions && Array.isArray(rel.settings.actions))
|
||||
.map((rel) => ({
|
||||
id: rel.id,
|
||||
sourceTable: rel.fromTable,
|
||||
actions: rel.settings?.actions || [],
|
||||
})),
|
||||
actions: (rel.settings?.actions || []).map((action: Record<string, unknown>) => ({
|
||||
id: action.id as string,
|
||||
name: action.name as string,
|
||||
actionType: action.actionType as "insert" | "update" | "delete" | "upsert",
|
||||
fieldMappings: ((action.fieldMappings as Record<string, unknown>[]) || []).map(
|
||||
(mapping: Record<string, unknown>) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { transformFunction, ...cleanMapping } = mapping;
|
||||
return cleanMapping as any; // transformFunction 제거 후 타입 캐스팅
|
||||
},
|
||||
),
|
||||
splitConfig: action.splitConfig,
|
||||
conditions: action.conditions,
|
||||
})),
|
||||
})) as any, // plan 전체를 any로 캐스팅
|
||||
};
|
||||
|
||||
if (diagramId && diagramId > 0) {
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ export interface JsonRelationship {
|
|||
fromColumns: string[];
|
||||
toColumns: string[];
|
||||
connectionType: "simple-key" | "data-save" | "external-call";
|
||||
settings?: Record<string, unknown>;
|
||||
// settings 제거 - relationships는 순수 연결 정보만 저장
|
||||
}
|
||||
|
||||
export interface CreateDiagramRequest {
|
||||
|
|
@ -692,7 +692,6 @@ export class DataFlowAPI {
|
|||
to_column_name: rel.toColumns.join(","),
|
||||
connection_type: rel.connectionType || "simple-key", // 각 관계의 connectionType 사용
|
||||
company_code: companyCode, // 실제 사용자 회사 코드 사용
|
||||
settings: rel.settings || {},
|
||||
created_at: jsonDiagram.created_at,
|
||||
updated_at: jsonDiagram.updated_at,
|
||||
created_by: jsonDiagram.created_by,
|
||||
|
|
|
|||
Loading…
Reference in New Issue