From 9b37ae72e7d15d246a79b6c26481d4ea520def5c Mon Sep 17 00:00:00 2001 From: Amos Machora Date: Wed, 27 Nov 2024 08:56:19 +0300 Subject: [PATCH] fix: flatten beds array before filtering --- .../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, );