From 1787f6d25dc767137dbe4551633ab5f24d91a88c Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Wed, 5 Feb 2025 09:35:06 -0500 Subject: [PATCH] Flatmap today's bookings (#19104) Co-authored-by: Keith Williams --- apps/web/modules/bookings/views/bookings-listing-view.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/modules/bookings/views/bookings-listing-view.tsx b/apps/web/modules/bookings/views/bookings-listing-view.tsx index 0442ff158f..7d1cb8102e 100644 --- a/apps/web/modules/bookings/views/bookings-listing-view.tsx +++ b/apps/web/modules/bookings/views/bookings-listing-view.tsx @@ -199,7 +199,7 @@ function BookingsContent({ status }: BookingsProps) { const bookingsToday = useMemo(() => { return ( - query.data?.pages.map((page) => + query.data?.pages.flatMap((page) => page.bookings .filter( (booking: BookingOutput) => @@ -214,7 +214,7 @@ function BookingsContent({ status }: BookingsProps) { ), isToday: true, })) - )[0] || [] + ) || [] ); }, [query.data]);