From c85841b59fe65ed00ca01775c20fd71ccd9531a1 Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Fri, 12 Dec 2025 13:46:20 +0900 Subject: [PATCH] =?UTF-8?q?fix(repeat-screen-modal):=20=EC=99=B8=EB=B6=80?= =?UTF-8?q?=20=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=A1=B0=EC=9D=B8=20=EC=8B=9C?= =?UTF-8?q?=20ID=20=ED=83=80=EC=9E=85=20=EB=B3=80=ED=99=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 조인 키가 '_id' 또는 'id'인 경우 문자열을 숫자로 변환 - 백엔드 ILIKE 검색 방지로 정확한 ID 매칭 보장 - API 호출 파라미터 로깅 추가 (디버깅용) --- .../RepeatScreenModalComponent.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/frontend/lib/registry/components/repeat-screen-modal/RepeatScreenModalComponent.tsx b/frontend/lib/registry/components/repeat-screen-modal/RepeatScreenModalComponent.tsx index 980bbfe9..d5490467 100644 --- a/frontend/lib/registry/components/repeat-screen-modal/RepeatScreenModalComponent.tsx +++ b/frontend/lib/registry/components/repeat-screen-modal/RepeatScreenModalComponent.tsx @@ -464,8 +464,17 @@ export function RepeatScreenModalComponent({ // 조인 조건 생성 const filters: Record = {}; for (const condition of dataSourceConfig.joinConditions) { - const refValue = representativeData[condition.referenceKey]; + let refValue = representativeData[condition.referenceKey]; if (refValue !== undefined && refValue !== null) { + // 숫자형 ID인 경우 숫자로 변환 (문자열 '189' → 숫자 189) + // 백엔드에서 entity 타입 컬럼 검색 시 문자열이면 ILIKE 검색을 수행하므로 + // 정확한 ID 매칭을 위해 숫자로 변환해야 함 + if (condition.sourceKey.endsWith('_id') || condition.sourceKey === 'id') { + const numValue = Number(refValue); + if (!isNaN(numValue)) { + refValue = numValue; + } + } filters[condition.sourceKey] = refValue; } } @@ -475,6 +484,14 @@ export function RepeatScreenModalComponent({ continue; } + console.log(`[RepeatScreenModal] 외부 테이블 API 호출:`, { + sourceTable: dataSourceConfig.sourceTable, + filters, + joinConditions: dataSourceConfig.joinConditions, + representativeDataId: representativeData.id, + representativeDataIdType: typeof representativeData.id, + }); + // API 호출 - 메인 테이블 데이터 const response = await apiClient.post( `/table-management/tables/${dataSourceConfig.sourceTable}/data`,