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`,