fix: columnMeta 로딩 완료 후 카테고리 매핑 로드

- columnMeta가 비어있을 때 로딩 대기 로그 출력
- columnMeta 준비 완료 후에만 카테고리 매핑 시도
- 카테고리 컬럼 없음 로그에 디버깅 정보 추가
- 화면 전환 시 columnMeta → 카테고리 매핑 순서 보장
This commit is contained in:
kjs 2025-11-06 12:26:07 +09:00
parent cd961a2162
commit 70dc24f7a1
1 changed files with 13 additions and 2 deletions

View File

@ -428,18 +428,29 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
useEffect(() => {
const loadCategoryMappings = async () => {
if (!tableConfig.selectedTable || !columnMeta) return;
if (!tableConfig.selectedTable) return;
// 로딩 중에는 매핑 로드하지 않음 (데이터 로드 완료 후에만 실행)
if (loading) return;
// columnMeta가 비어있으면 대기
const columnMetaKeys = Object.keys(columnMeta || {});
if (columnMetaKeys.length === 0) {
console.log("⏳ [TableList] columnMeta 로딩 대기 중...");
return;
}
try {
const categoryColumns = Object.entries(columnMeta)
.filter(([_, meta]) => meta.inputType === "category")
.map(([columnName, _]) => columnName);
if (categoryColumns.length === 0) {
console.log("⚠️ [TableList] 카테고리 컬럼 없음");
console.log("⚠️ [TableList] 카테고리 컬럼 없음:", {
table: tableConfig.selectedTable,
columnMetaKeys,
columnMeta,
});
return;
}