Skip to content

Commit

Permalink
Fix inconsistent removal of facility filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Omkar76 committed Jan 15, 2024
1 parent 51b02c2 commit 74f2737
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Components/Facility/HospitalList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
downloadFacilityDoctors,
downloadFacilityTriage,
} from "../../Redux/actions";
import { lazy } from "react";
import { lazy, useEffect } from "react";
import { AdvancedFilterButton } from "../../CAREUI/interactive/FiltersSlideover";
import CountBlock from "../../CAREUI/display/Count";
import ExportMenu from "../Common/Export";
Expand Down Expand Up @@ -35,6 +35,16 @@ export const HospitalList = () => {
} = useFilters({
limit: 14,
});

useEffect(() => {
if (!qParams.state) {
advancedFilter.removeFilters(["district", "local_body"]);
}
if (!qParams.district) {
advancedFilter.removeFilters(["local_body"]);
}
}, [advancedFilter, qParams]);

let manageFacilities: any = null;
const { user_type } = useAuthUser();
const { t } = useTranslation();
Expand Down

0 comments on commit 74f2737

Please sign in to comment.