From a8fc5cbd92b070e55f5a44255125d4d5c2900c54 Mon Sep 17 00:00:00 2001 From: hyeonsu Date: Fri, 19 Sep 2025 11:00:47 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EB=B2=A8=EC=9D=B4=20=EC=97=86?= =?UTF-8?q?=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20=EC=98=A4=EB=A5=98=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/tableManagementController.ts | 28 ++++++++----------- frontend/lib/api/dataflow.ts | 9 ++++-- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/backend-node/src/controllers/tableManagementController.ts b/backend-node/src/controllers/tableManagementController.ts index 10f76e72..c3192a6f 100644 --- a/backend-node/src/controllers/tableManagementController.ts +++ b/backend-node/src/controllers/tableManagementController.ts @@ -282,15 +282,13 @@ export async function getTableLabels( const tableLabels = await tableManagementService.getTableLabels(tableName); if (!tableLabels) { - const response: ApiResponse = { - success: false, - message: "테이블 라벨 정보를 찾을 수 없습니다.", - error: { - code: "TABLE_LABELS_NOT_FOUND", - details: `테이블 ${tableName}의 라벨 정보가 존재하지 않습니다.`, - }, + // 라벨이 없으면 빈 객체를 성공으로 반환 (404 에러 대신) + const response: ApiResponse<{}> = { + success: true, + message: "테이블 라벨 정보를 조회했습니다.", + data: {}, }; - res.status(404).json(response); + res.status(200).json(response); return; } @@ -350,15 +348,13 @@ export async function getColumnLabels( ); if (!columnLabels) { - const response: ApiResponse = { - success: false, - message: "컬럼 라벨 정보를 찾을 수 없습니다.", - error: { - code: "COLUMN_LABELS_NOT_FOUND", - details: `컬럼 ${tableName}.${columnName}의 라벨 정보가 존재하지 않습니다.`, - }, + // 라벨이 없으면 빈 객체를 성공으로 반환 (404 에러 대신) + const response: ApiResponse<{}> = { + success: true, + message: "컬럼 라벨 정보를 조회했습니다.", + data: {}, }; - res.status(404).json(response); + res.status(200).json(response); return; } diff --git a/frontend/lib/api/dataflow.ts b/frontend/lib/api/dataflow.ts index 2e5610a5..48a59529 100644 --- a/frontend/lib/api/dataflow.ts +++ b/frontend/lib/api/dataflow.ts @@ -406,9 +406,12 @@ export class DataFlowAPI { tableLabel = response.data.data.tableLabel || tableName; tableDescription = response.data.data.description || `${tableName} 테이블`; } - } catch { - // 라벨 정보가 없으면 기본값 사용 - console.log(`테이블 라벨 정보 없음: ${tableName}`); + } catch (error) { + // 라벨 정보가 없으면 기본값 사용 (404 등의 에러는 무시) + const axiosError = error as { response?: { status?: number } }; + if (axiosError?.response?.status !== 404) { + console.warn(`테이블 라벨 조회 중 예상치 못한 오류: ${tableName}`, error); + } } // TableNode가 기대하는 컬럼 구조로 변환