fix: SelectedItemsDetailInput Select 빈 값 에러 수정 및 inputType 디버깅 로그 추가

- Select 컴포넌트에서 빈 문자열 value를 가진 SelectItem 제거
- category/code 타입 필드의 옵션 로딩 디버깅 로그 추가
- 빈 값 필터링으로 'SelectItem must not have empty value' 에러 해결
- codeCategory 자동 감지 로직 디버깅 강화
This commit is contained in:
kjs
2025-11-17 15:59:25 +09:00
parent 5bf3c0fcd7
commit 289677a971
3 changed files with 43 additions and 30 deletions

View File

@@ -144,6 +144,19 @@ export class TableManagementService {
logger.info(
`컬럼 정보 캐시에서 조회: ${tableName}, ${cachedResult.columns.length}/${cachedResult.total}`
);
// 디버깅: 캐시된 currency_code 확인
const cachedCurrency = cachedResult.columns.find(
(col: any) => col.columnName === "currency_code"
);
if (cachedCurrency) {
console.log(`💾 [캐시] currency_code:`, {
columnName: cachedCurrency.columnName,
inputType: cachedCurrency.inputType,
webType: cachedCurrency.webType,
});
}
return cachedResult;
}
@@ -165,10 +178,6 @@ export class TableManagementService {
const offset = (page - 1) * size;
// 🔥 company_code가 있으면 table_type_columns 조인하여 회사별 inputType 가져오기
console.log(
`🔍 [getColumnList] 시작: table=${tableName}, company=${companyCode}`
);
const rawColumns = companyCode
? await query<any>(
`SELECT
@@ -256,22 +265,6 @@ export class TableManagementService {
[tableName, size, offset]
);
// 디버깅: currency_code 확인
const currencyCol = rawColumns.find(
(col: any) => col.columnName === "currency_code"
);
if (currencyCol) {
console.log(`🎯 [getColumnList] currency_code 원본 쿼리 결과:`, {
columnName: currencyCol.columnName,
inputType: currencyCol.inputType,
ttc_input_type: currencyCol.ttc_input_type,
cl_input_type: currencyCol.cl_input_type,
webType: currencyCol.webType,
});
} else {
console.log(`⚠️ [getColumnList] currency_code가 rawColumns에 없음`);
}
// 🆕 category_column_mapping 조회
const tableExistsResult = await query<any>(
`SELECT EXISTS (
@@ -804,8 +797,13 @@ export class TableManagementService {
]
);
// 🔥 캐시 무효화: 해당 테이블의 컬럼 캐시 삭제
const cacheKeyPattern = `${CacheKeys.TABLE_COLUMNS(tableName, 1, 1000)}_${companyCode}`;
cache.delete(cacheKeyPattern);
cache.delete(CacheKeys.TABLE_COLUMN_COUNT(tableName));
logger.info(
`컬럼 입력 타입 설정 완료: ${tableName}.${columnName} = ${inputType}, company: ${companyCode}`
`컬럼 입력 타입 설정 완료: ${tableName}.${columnName} = ${inputType}, company: ${companyCode} (캐시 무효화 완료)`
);
} catch (error) {
logger.error(