diff --git a/components/HotelReservation/ReadMore/index.tsx b/components/HotelReservation/ReadMore/index.tsx index c8d39fcbe..7efa4f4e8 100644 --- a/components/HotelReservation/ReadMore/index.tsx +++ b/components/HotelReservation/ReadMore/index.tsx @@ -16,22 +16,17 @@ import Contact from "../Contact" import styles from "./readMore.module.css" import { - DetailedAmenity, ParkingProps, ReadMoreProps, } from "@/types/components/hotelReservation/selectHotel/selectHotel" -import { Hotel } from "@/types/hotel" +import type { Amenities,Hotel } from "@/types/hotel" function getAmenitiesList(hotel: Hotel) { - const detailedAmenities: DetailedAmenity[] = Object.entries( - hotel.hotelFacts.hotelFacilityDetail - ).map(([key, value]) => ({ name: key, ...value })) - - // Remove Parking facilities since parking accordion is based on hotel.parking - const simpleAmenities = hotel.detailedFacilities.filter( - (facility) => !facility.name.startsWith("Parking") + const detailedAmenities: Amenities = hotel.detailedFacilities.filter( + // Remove Parking facilities since parking accordion is based on hotel.parking + (facility) => !facility.name.startsWith("Parking") && facility.public ) - return [...detailedAmenities, ...simpleAmenities] + return detailedAmenities } export default function ReadMore({ label, hotel, hotelId }: ReadMoreProps) { @@ -80,11 +75,7 @@ export default function ReadMore({ label, hotel, hotelId }: ReadMoreProps) { TODO: What content should be in the accessibility section? {amenitiesList.map((amenity) => { - return "description" in amenity ? ( - - {amenity.description} - - ) : ( + return (
{amenity.name}
diff --git a/server/routers/hotels/output.ts b/server/routers/hotels/output.ts index b69207a7d..1b49b5fbf 100644 --- a/server/routers/hotels/output.ts +++ b/server/routers/hotels/output.ts @@ -71,34 +71,6 @@ const ecoLabelsSchema = z.object({ svanenEcoLabelCertificateNumber: z.string().optional(), }) -const hotelFacilityDetailSchema = z.object({ - heading: z.string(), - description: z.string(), -}) - -const hotelFacilitySchema = z.object({ - breakfast: hotelFacilityDetailSchema, - checkout: hotelFacilityDetailSchema, - gym: hotelFacilityDetailSchema, - internet: hotelFacilityDetailSchema, - laundry: hotelFacilityDetailSchema, - luggage: hotelFacilityDetailSchema, - shop: hotelFacilityDetailSchema, - telephone: hotelFacilityDetailSchema, -}) - -const hotelInformationDetailSchema = z.object({ - heading: z.string(), - description: z.string(), - link: z.string().optional(), -}) - -const hotelInformationSchema = z.object({ - accessibility: hotelInformationDetailSchema, - safety: hotelInformationDetailSchema, - sustainability: hotelInformationDetailSchema, -}) - const interiorSchema = z.object({ numberOfBeds: z.number(), numberOfCribs: z.number(), @@ -423,8 +395,6 @@ export const getHotelDataSchema = z.object({ hotelFacts: z.object({ checkin: checkinSchema, ecoLabels: ecoLabelsSchema, - hotelFacilityDetail: hotelFacilitySchema, - hotelInformation: hotelInformationSchema, interior: interiorSchema, receptionHours: receptionHoursSchema, yearBuilt: z.string(), diff --git a/types/components/hotelReservation/selectHotel/selectHotel.ts b/types/components/hotelReservation/selectHotel/selectHotel.ts index b43779714..b50521040 100644 --- a/types/components/hotelReservation/selectHotel/selectHotel.ts +++ b/types/components/hotelReservation/selectHotel/selectHotel.ts @@ -5,12 +5,6 @@ export enum AvailabilityEnum { NotAvailable = "NotAvailable", } -export interface DetailedAmenity { - name: string - heading: string - description: string -} - export interface ReadMoreProps { label: string hotelId: string