webtype 엔티티 수정

This commit is contained in:
hyeonsu
2025-09-21 10:28:15 +09:00
parent 43e335d271
commit 33600ce667
2 changed files with 68 additions and 14 deletions

View File

@@ -75,9 +75,12 @@ export const WebTypeInput: React.FC<WebTypeInputProps> = ({ column, value, onCha
referenceTable: column.referenceTable,
displayColumn: column.displayColumn,
codeCategory: column.codeCategory,
detailSettings,
fallbackCodeCategory,
});
if (webType === "entity" && column.tableName && column.columnName) {
// webType이 entity이거나, referenceTable이 있으면 entity로 처리
if ((webType === "entity" || column.referenceTable) && column.tableName && column.columnName) {
console.log("🚀 Entity 데이터 로드 시작:", column.tableName, column.columnName);
loadEntityData();
} else if (webType === "code" && (column.codeCategory || detailSettings.codeCategory || fallbackCodeCategory)) {
@@ -85,9 +88,15 @@ export const WebTypeInput: React.FC<WebTypeInputProps> = ({ column, value, onCha
console.log("🚀 Code 데이터 로드 시작:", codeCategory);
loadCodeData();
} else {
console.log("❌ 조건 불충족 - API 호출 안함");
console.log("❌ 조건 불충족 - API 호출 안함", {
webType,
hasReferenceTable: !!column.referenceTable,
hasTableName: !!column.tableName,
hasColumnName: !!column.columnName,
hasCodeCategory: !!(column.codeCategory || detailSettings.codeCategory || fallbackCodeCategory),
});
}
}, [webType, column.tableName, column.columnName, column.codeCategory, fallbackCodeCategory]);
}, [webType, column.tableName, column.columnName, column.codeCategory, column.referenceTable, fallbackCodeCategory]);
const loadEntityData = async () => {
try {
@@ -130,8 +139,10 @@ export const WebTypeInput: React.FC<WebTypeInputProps> = ({ column, value, onCha
className,
};
// WebType별 렌더링
switch (webType) {
// WebType별 렌더링 (referenceTable이 있으면 entity로 처리)
const actualWebType = webType === "entity" || column.referenceTable ? "entity" : webType;
switch (actualWebType) {
case "text":
return (
<Input