diff --git a/src/Components/Facility/CentralNursingStation.tsx b/src/Components/Facility/CentralNursingStation.tsx index 75214b5506c..186dbbd48e9 100644 --- a/src/Components/Facility/CentralNursingStation.tsx +++ b/src/Components/Facility/CentralNursingStation.tsx @@ -48,7 +48,8 @@ export default function CentralNursingStation({ facilityId }: Props) { offset: (qParams.page ? qParams.page - 1 : 0) * PER_PAGE_LIMIT, asset_class: "HL7MONITOR", ordering: qParams.ordering || "bed__name", - bed_is_occupied: qParams.bed_is_occupied ?? true, + bed_is_occupied: + (qParams.hide_monitors_without_patient ?? "true") === "true", }, }); @@ -149,19 +150,12 @@ export default function CentralNursingStation({ facilityId }: Props) { errorClassName="hidden" /> { - if (value) { - updateQuery({ [name]: value }); - } else { - removeFilter(name); - } - }} + value={JSON.parse( + qParams.hide_monitors_without_patient ?? true + )} + onChange={(e) => updateQuery({ [e.name]: e.value })} labelClassName="text-sm" errorClassName="hidden" /> @@ -197,7 +191,7 @@ export default function CentralNursingStation({ facilityId }: Props) { } > - {data === undefined ? ( + {data === undefined || query.loading ? ( ) : data.length === 0 ? (