From 436d604bb3219b708bf8d647132e126302e849c9 Mon Sep 17 00:00:00 2001 From: dohyeons Date: Tue, 2 Dec 2025 11:12:09 +0900 Subject: [PATCH] =?UTF-8?q?REST=20API=20=EC=97=B0=EA=B2=B0=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=8B=9C=20=ED=9A=8C=EC=82=AC=EB=B3=84=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0=EB=AA=85=20=EC=A4=91=EB=B3=B5=20=ED=97=88=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend-node/src/routes/externalRestApiConnectionRoutes.ts | 2 ++ backend-node/src/services/externalRestApiConnectionService.ts | 1 + frontend/components/admin/RestApiConnectionModal.tsx | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend-node/src/routes/externalRestApiConnectionRoutes.ts b/backend-node/src/routes/externalRestApiConnectionRoutes.ts index 48813575..14fd17d0 100644 --- a/backend-node/src/routes/externalRestApiConnectionRoutes.ts +++ b/backend-node/src/routes/externalRestApiConnectionRoutes.ts @@ -97,6 +97,8 @@ router.post( const data: ExternalRestApiConnection = { ...req.body, created_by: req.user?.userId || "system", + // 로그인 사용자의 company_code 사용 (프론트에서 안 보내도 자동 설정) + company_code: req.body.company_code || req.user?.companyCode || "*", }; const result = diff --git a/backend-node/src/services/externalRestApiConnectionService.ts b/backend-node/src/services/externalRestApiConnectionService.ts index af37eff1..cc1a46e5 100644 --- a/backend-node/src/services/externalRestApiConnectionService.ts +++ b/backend-node/src/services/externalRestApiConnectionService.ts @@ -233,6 +233,7 @@ export class ExternalRestApiConnectionService { // 디버깅: 저장하려는 데이터 로깅 logger.info(`REST API 연결 생성 요청 데이터:`, { connection_name: data.connection_name, + company_code: data.company_code, default_method: data.default_method, endpoint_path: data.endpoint_path, base_url: data.base_url, diff --git a/frontend/components/admin/RestApiConnectionModal.tsx b/frontend/components/admin/RestApiConnectionModal.tsx index aa7d79d8..3de34800 100644 --- a/frontend/components/admin/RestApiConnectionModal.tsx +++ b/frontend/components/admin/RestApiConnectionModal.tsx @@ -232,7 +232,7 @@ export function RestApiConnectionModal({ isOpen, onClose, onSave, connection }: timeout, retry_count: retryCount, retry_delay: retryDelay, - company_code: "*", + // company_code는 백엔드에서 로그인 사용자의 company_code로 자동 설정 is_active: isActive ? "Y" : "N", };