여러 컬럼 선택시 쉼표로 구분
This commit is contained in:
parent
4bd7243e1e
commit
989c118ad2
|
|
@ -171,22 +171,49 @@ export const ConnectionSetupModal: React.FC<ConnectionSetupModalProps> = ({
|
|||
break;
|
||||
}
|
||||
|
||||
// API 호출을 위한 관계 데이터 준비
|
||||
// 선택된 컬럼들 추출
|
||||
const selectedColumnsData = connection.selectedColumnsData || {};
|
||||
const tableNames = Object.keys(selectedColumnsData);
|
||||
const fromTable = tableNames[0];
|
||||
const toTable = tableNames[1];
|
||||
|
||||
const fromColumns = selectedColumnsData[fromTable]?.columns || [];
|
||||
const toColumns = selectedColumnsData[toTable]?.columns || [];
|
||||
|
||||
if (fromColumns.length === 0 || toColumns.length === 0) {
|
||||
toast.error("선택된 컬럼이 없습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
toast.loading("관계를 생성하고 있습니다...", { id: "create-relationship" });
|
||||
|
||||
// 단일 관계 데이터 준비 (모든 선택된 컬럼 정보 포함)
|
||||
const relationshipData: Omit<TableRelationship, "relationshipId"> = {
|
||||
relationshipName: config.relationshipName,
|
||||
fromTableName: connection.fromNode.tableName,
|
||||
fromColumnName: connection.fromColumn || "",
|
||||
fromColumnName: fromColumns.join(","), // 여러 컬럼을 콤마로 구분
|
||||
toTableName: connection.toNode.tableName,
|
||||
toColumnName: connection.toColumn || "",
|
||||
toColumnName: toColumns.join(","), // 여러 컬럼을 콤마로 구분
|
||||
relationshipType: config.relationshipType,
|
||||
connectionType: config.connectionType,
|
||||
companyCode: companyCode,
|
||||
settings: settings,
|
||||
settings: {
|
||||
...settings,
|
||||
multiColumnMapping: {
|
||||
fromColumns: fromColumns,
|
||||
toColumns: toColumns,
|
||||
fromTable: selectedColumnsData[fromTable]?.displayName || fromTable,
|
||||
toTable: selectedColumnsData[toTable]?.displayName || toTable,
|
||||
},
|
||||
isMultiColumn: fromColumns.length > 1 || toColumns.length > 1,
|
||||
columnCount: {
|
||||
from: fromColumns.length,
|
||||
to: toColumns.length,
|
||||
},
|
||||
},
|
||||
isActive: "Y",
|
||||
};
|
||||
|
||||
toast.loading("관계를 생성하고 있습니다...", { id: "create-relationship" });
|
||||
|
||||
// API 호출
|
||||
const createdRelationship = await DataFlowAPI.createRelationship(relationshipData);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue