Merge branch 'dev' of http://39.117.244.52:3000/kjs/ERP-node into external-connections
This commit is contained in:
commit
b27edae0f3
|
|
@ -556,26 +556,9 @@ export const ConnectionSetupModal: React.FC<ConnectionSetupModalProps> = ({
|
|||
return true; // DELETE는 필드 매핑 검증 생략
|
||||
}
|
||||
|
||||
// INSERT 액션의 경우 모든 TO 테이블 컬럼이 매핑되거나 기본값이 있어야 함
|
||||
// INSERT 액션의 경우 최소 하나의 매핑이 있으면 됨 (모든 컬럼 매핑 필수 조건 제거)
|
||||
if (action.actionType === "insert") {
|
||||
// TO 테이블의 모든 컬럼을 찾기
|
||||
const toTableName = action.fieldMappings[0]?.targetTable;
|
||||
if (!toTableName) return false;
|
||||
|
||||
const toTableColumns = tableColumnsCache[toTableName] || [];
|
||||
if (toTableColumns.length === 0) return false;
|
||||
|
||||
// 모든 TO 컬럼이 매핑되거나 기본값이 있는지 확인
|
||||
return toTableColumns.every((column) => {
|
||||
const mapping = action.fieldMappings.find((m) => m.targetField === column.columnName);
|
||||
if (!mapping) return false;
|
||||
|
||||
// 소스 매핑 또는 기본값 중 하나는 있어야 함
|
||||
const hasSource = mapping.sourceTable && mapping.sourceField;
|
||||
const hasDefault = mapping.defaultValue && mapping.defaultValue.trim();
|
||||
|
||||
return hasSource || hasDefault;
|
||||
});
|
||||
return true; // 필드 매핑이 있으면 충분함
|
||||
}
|
||||
|
||||
return action.fieldMappings.every((mapping) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue