fix: 캐시에서 inputType 누락 문제 해결
- 캐시된 데이터 사용 시 inputType이 설정되지 않던 문제 수정 - cached.inputTypes를 올바르게 매핑하여 meta에 포함 - webType 체크 제거, inputType만 사용하도록 변경 - 화면 전환 후 캐시 사용 시에도 카테고리 타입 정상 인식
This commit is contained in:
parent
4cd08c3900
commit
85e1b532fa
|
|
@ -338,13 +338,22 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
|||
const cached = tableColumnCache.get(cacheKey);
|
||||
if (cached && Date.now() - cached.timestamp < TABLE_CACHE_TTL) {
|
||||
const labels: Record<string, string> = {};
|
||||
const meta: Record<string, { webType?: string; codeCategory?: string }> = {};
|
||||
const meta: Record<string, { webType?: string; codeCategory?: string; inputType?: string }> = {};
|
||||
|
||||
// 캐시된 inputTypes 맵 생성
|
||||
const inputTypeMap: Record<string, string> = {};
|
||||
if (cached.inputTypes) {
|
||||
cached.inputTypes.forEach((col: any) => {
|
||||
inputTypeMap[col.columnName] = col.inputType;
|
||||
});
|
||||
}
|
||||
|
||||
cached.columns.forEach((col: any) => {
|
||||
labels[col.columnName] = col.displayName || col.comment || col.columnName;
|
||||
meta[col.columnName] = {
|
||||
webType: col.webType,
|
||||
codeCategory: col.codeCategory,
|
||||
inputType: inputTypeMap[col.columnName], // 캐시된 inputType 사용!
|
||||
};
|
||||
});
|
||||
|
||||
|
|
@ -442,7 +451,7 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
|||
|
||||
try {
|
||||
const categoryColumns = Object.entries(columnMeta)
|
||||
.filter(([_, meta]) => meta.inputType === "category" || meta.webType === "category")
|
||||
.filter(([_, meta]) => meta.inputType === "category")
|
||||
.map(([columnName, _]) => columnName);
|
||||
|
||||
if (categoryColumns.length === 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue