diff --git a/apps/st/src/components/statistics/verification/StatisticsVerificationReport.tsx b/apps/st/src/components/statistics/verification/StatisticsVerificationReport.tsx index 75416eb35..38797a591 100644 --- a/apps/st/src/components/statistics/verification/StatisticsVerificationReport.tsx +++ b/apps/st/src/components/statistics/verification/StatisticsVerificationReport.tsx @@ -173,6 +173,7 @@ function StatisticsVerificationReport() { ); const resultGridRef = useRef(null); const prevLengthRef = useRef(0); + const rejectedVrfcSnRef = useRef>(new Set()); const { data: sidoData } = useStAnlsSidoCombo(); const { data: sigunguData } = useStAnlsSigunguCombo( @@ -299,10 +300,14 @@ function StatisticsVerificationReport() { dataProvider.addRows?.(mergedNewRows); } else { // 초기 조회 또는 재조회 시 데이터 처리 - const checkedKeys = captureCheckedVrfcSn(); + const rejectedKeys = rejectedVrfcSnRef.current; + const checkedKeys = captureCheckedVrfcSn().filter( + (key) => !rejectedKeys.has(key), + ); const mergedRows = mergeWithEditedMap(nextRows); dataProvider.setRows?.(mergedRows); restoreCheckedVrfcSn(checkedKeys, mergedRows); + rejectedKeys.clear(); } prevLengthRef.current = nextRows.length; @@ -514,6 +519,10 @@ function StatisticsVerificationReport() { try { if (await confirm("반려하시겠습니까?")) { await onRejectStats(rejectRequests); + rejectRequests.forEach(({ vrfcSn }) => { + if (!Number.isNaN(vrfcSn)) + rejectedVrfcSnRef.current.add(vrfcSn); + }); } } catch { alert("반려 중 오류가 발생했습니다.");