From 024a095dc65e8e1b55750ea849f8624cfb626aec Mon Sep 17 00:00:00 2001 From: Fredrik Thorsson Date: Thu, 5 Sep 2024 13:25:46 +0200 Subject: [PATCH] feat(SW-251): check for undefined --- .../hotelreservation/select-hotel/page.tsx | 4 +++- .../SelectHotel/HotelFilter/index.tsx | 19 +++++++------------ server/routers/hotels/query.ts | 10 +++++----- .../selectHotel/hotelFilterProps.ts | 3 +-- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx index cb2e8cd43..1a75c56f5 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx @@ -28,6 +28,8 @@ export default async function SelectHotelPage({ if (!getHotelFitlers) return null + const { filters } = getHotelFitlers + const getAvailableHotels = await serverClient().hotel.availability.get({ cityId: "8ec4bba3-1c38-4606-82d1-bbe3f6738e54", roomStayStartDate: "2024-11-02", @@ -54,7 +56,7 @@ export default async function SelectHotelPage({ {intl.formatMessage({ id: "Show map" })} - {/* */} +
{availability.length ? ( diff --git a/components/HotelReservation/SelectHotel/HotelFilter/index.tsx b/components/HotelReservation/SelectHotel/HotelFilter/index.tsx index fe7b98fe9..f002c83b9 100644 --- a/components/HotelReservation/SelectHotel/HotelFilter/index.tsx +++ b/components/HotelReservation/SelectHotel/HotelFilter/index.tsx @@ -4,25 +4,20 @@ import styles from "./hotelFilter.module.css" import { HotelFilterProps } from "@/types/components/hotelReservation/selectHotel/hotelFilterProps" -export default async function HotelFilter({ - hotelId, - filters, -}: HotelFilterProps) { +export default async function HotelFilter({ filters }: HotelFilterProps) { const { formatMessage } = await getIntl() + console.log(filters) + return (