diff --git a/app/[lang]/(live)/(public)/hotelreservation/[section]/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/[section]/page.tsx index 0ad99c442..ecd62644b 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/[section]/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/[section]/page.tsx @@ -1,7 +1,6 @@ import { serverClient } from "@/lib/trpc/server" import tempHotelData from "@/server/routers/hotels/tempHotelData.json" -import HotelCard from "@/components/HotelReservation/HotelCard" import BedSelection from "@/components/HotelReservation/SelectRate/BedSelection" import BreakfastSelection from "@/components/HotelReservation/SelectRate/BreakfastSelection" import Details from "@/components/HotelReservation/SelectRate/Details" @@ -108,7 +107,7 @@ export default async function SectionsPage({ return (
- +
Hotel Card TBI
diff --git a/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx index 579b07f93..56302d36b 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx @@ -20,19 +20,22 @@ export default async function SelectHotelPage({ setLang(params.lang) const tempSearchTerm = "Stockholm" - const hotelFilters = await serverClient().hotel.filters.get({ hotelId: "879", }) - const availability = await serverClient().hotel.availability.get({ + const availabilityResponse = await serverClient().hotel.availability.get({ cityId: "8ec4bba3-1c38-4606-82d1-bbe3f6738e54", roomStayStartDate: "2024-11-02", roomStayEndDate: "2024-11-03", adults: 1, }) - const filterAvailability = availability?.availability.data + if (!availabilityResponse) return null + + const { availability } = availabilityResponse + + const filterAvailability = availability.data .filter((hotels) => hotels.attributes.status === "Available") .flatMap((hotels) => hotels.attributes) @@ -53,7 +56,7 @@ export default async function SelectHotelPage({
- {filterAvailability?.length ? ( + {filterAvailability.length ? ( filterAvailability.map((hotel) => ( b.sortOrder - a.sortOrder) .slice(0, 5) @@ -44,8 +46,8 @@ export default async function HotelCard({
{hotelData.hotel.hotelContent.images.metaData.altText} - {hotelData.hotel.ratings?.tripAdvisor.rating} + {hotel.ratings?.tripAdvisor.rating}
- {hotelData.hotel.name} + {hotel.name} - {`${hotelData.hotel.address.streetAddress}, ${hotelData.hotel.address.city}`} + {`${hotel.address.streetAddress}, ${hotel.address.city}`} - {`${hotelData.hotel.location.distanceToCentre} ${intl.formatMessage({ id: "km to city center" })}`} + {`${hotel.location.distanceToCentre} ${intl.formatMessage({ id: "km to city center" })}`}