[st] refactor: HB 통계검증 상세 시도/시군구 필터 코드
This commit is contained in:
@@ -77,24 +77,16 @@ const RegionalGrid: React.FC<RegionalGridProps> = ({
|
||||
) {
|
||||
data = showAllOnEmptyFilter ? data : [];
|
||||
} else {
|
||||
if (appliedFilter.sido) {
|
||||
const sidoCd = sidoOptions.find(
|
||||
(opt) => opt.adstCd === appliedFilter.sido,
|
||||
)?.adstCd;
|
||||
if (sidoCd) {
|
||||
data = data.filter((item) =>
|
||||
item.admdstCd.startsWith(sidoCd.slice(0, 2)),
|
||||
);
|
||||
}
|
||||
const sidoCd = appliedFilter.sido;
|
||||
if (sidoCd) {
|
||||
data = data.filter((item) =>
|
||||
item.admdstCd.startsWith(sidoCd.slice(0, 2)),
|
||||
);
|
||||
}
|
||||
|
||||
if (appliedFilter.gugun) {
|
||||
const gugunCd = gugunOptions.find(
|
||||
(opt) => opt.adstCd === appliedFilter.gugun,
|
||||
)?.adstCd;
|
||||
if (gugunCd) {
|
||||
data = data.filter((item) => item.admdstCd === gugunCd);
|
||||
}
|
||||
const gugunCd = appliedFilter.gugun;
|
||||
if (gugunCd) {
|
||||
data = data.filter((item) => item.admdstCd === gugunCd);
|
||||
}
|
||||
|
||||
if (appliedFilter.status) {
|
||||
@@ -124,13 +116,7 @@ const RegionalGrid: React.FC<RegionalGridProps> = ({
|
||||
}));
|
||||
|
||||
return mappedData;
|
||||
}, [
|
||||
resultData,
|
||||
appliedFilter,
|
||||
showAllOnEmptyFilter,
|
||||
sidoOptions,
|
||||
gugunOptions,
|
||||
]);
|
||||
}, [resultData, appliedFilter, showAllOnEmptyFilter]);
|
||||
|
||||
const handleSidoChange = (val: string) => {
|
||||
setSelectedSido(val);
|
||||
|
||||
Reference in New Issue
Block a user