빌드 에러 해결

This commit is contained in:
dohyeons
2025-11-07 10:18:34 +09:00
parent 0313c83a65
commit 920cdccdf9
4 changed files with 18 additions and 21 deletions

View File

@@ -63,9 +63,9 @@ export async function mergeCodeAllTables(
);
// 결과 처리 (pool.query 반환 타입 처리)
const affectedTables = Array.isArray(result) ? result : (result.rows || []);
const affectedTables = Array.isArray(result) ? result : ((result as any).rows || []);
const totalRows = affectedTables.reduce(
(sum, row) => sum + parseInt(row.rows_updated || 0),
(sum: number, row: any) => sum + parseInt(row.rows_updated || 0),
0
);
@@ -148,16 +148,17 @@ export async function getTablesWithColumn(
`;
const result = await pool.query(query, [columnName]);
const rows = (result as any).rows || [];
logger.info(`컬럼을 가진 테이블 조회 완료: ${result.rows.length}`);
logger.info(`컬럼을 가진 테이블 조회 완료: ${rows.length}`);
res.json({
success: true,
message: "테이블 목록 조회 성공",
data: {
columnName,
tables: result.rows.map((row) => row.table_name),
count: result.rows.length,
tables: rows.map((row: any) => row.table_name),
count: rows.length,
},
});
} catch (error: any) {
@@ -223,7 +224,7 @@ export async function previewCodeMerge(
// 각 테이블에서 영향받을 행 수 계산
const preview = [];
const tableRows = Array.isArray(tablesResult) ? tablesResult : (tablesResult.rows || []);
const tableRows = Array.isArray(tablesResult) ? tablesResult : ((tablesResult as any).rows || []);
for (const row of tableRows) {
const tableName = row.table_name;
@@ -234,7 +235,8 @@ export async function previewCodeMerge(
try {
const countResult = await pool.query(countQuery, [oldValue, companyCode]);
const count = parseInt(countResult.rows[0].count);
const rows = (countResult as any).rows || [];
const count = rows.length > 0 ? parseInt(rows[0].count) : 0;
if (count > 0) {
preview.push({