From c8d3f0678887c36ad4ce8ccf1086ae3090d3f71f Mon Sep 17 00:00:00 2001 From: Amos Machora Date: Wed, 27 Nov 2024 21:44:28 +0300 Subject: [PATCH] fix: flatten beds array before filtering (#1388) --- .../bed-administration/bed-administration-table.component.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/esm-bed-management-app/src/bed-administration/bed-administration-table.component.tsx b/packages/esm-bed-management-app/src/bed-administration/bed-administration-table.component.tsx index 00649f232..1cb7fd1c5 100644 --- a/packages/esm-bed-management-app/src/bed-administration/bed-administration-table.component.tsx +++ b/packages/esm-bed-management-app/src/bed-administration/bed-administration-table.component.tsx @@ -72,7 +72,7 @@ const BedAdministrationTable: React.FC = () => { const { results, currentPage, totalPages, goTo } = usePagination( filterOption === 'ALL' ? bedsGroupedByLocation - : bedsGroupedByLocation.filter((bed) => bed.status === filterOption) ?? [], + : bedsGroupedByLocation.flat().filter((bed) => bed.status === filterOption) ?? [], pageSize, );