Flatmap today's bookings (#19104)

Co-authored-by: Keith Williams <keithwillcode@gmail.com>
This commit is contained in:
Joe Au-Yeung
2025-02-05 14:35:06 +00:00
committed by GitHub
co-authored by Keith Williams
parent afa83ddb7f
commit 1787f6d25d
@@ -199,7 +199,7 @@ function BookingsContent({ status }: BookingsProps) {
const bookingsToday = useMemo<RowData[]>(() => {
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]);