Merged in fix/linkedReservation-typings (pull request #1431)
fix: linkedReservation typings * fix: correct rinkedReservation typings Approved-by: Christian Andolf Approved-by: Simon.Emanuelsson
This commit is contained in:
@@ -20,7 +20,7 @@ export default async function Rooms({
|
||||
return (
|
||||
<section className={styles.rooms}>
|
||||
<div className={styles.room}>
|
||||
{(linkedReservations?.length ?? 0 > 0) ? (
|
||||
{linkedReservations.length ? (
|
||||
<Subtitle color="mainGrey60" type="two">
|
||||
{intl.formatMessage({ id: "Room {roomIndex}" }, { roomIndex: 1 })}
|
||||
</Subtitle>
|
||||
@@ -32,7 +32,7 @@ export default async function Rooms({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{linkedReservations?.map((reservation, idx) => (
|
||||
{linkedReservations.map((reservation, idx) => (
|
||||
<div className={styles.room} key={reservation.confirmationNumber}>
|
||||
<Subtitle color="mainGrey60" type="two">
|
||||
{intl.formatMessage(
|
||||
|
||||
@@ -2,6 +2,7 @@ import { z } from "zod"
|
||||
|
||||
import { ChildBedTypeEnum } from "@/constants/booking"
|
||||
|
||||
import { nullableArrayObjectValidator } from "@/utils/zod/arrayValidator"
|
||||
import { phoneValidator } from "@/utils/zod/phoneValidator"
|
||||
import { nullableStringValidator } from "@/utils/zod/stringValidator"
|
||||
|
||||
@@ -198,10 +199,9 @@ export const bookingConfirmationSchema = z
|
||||
currencyCode: z.string(),
|
||||
guest: guestSchema,
|
||||
isGuaranteedForLateArrival: z.boolean().optional(),
|
||||
linkedReservations: z
|
||||
.array(linkedReservationSchema)
|
||||
.nullish()
|
||||
.transform((v) => v ?? []),
|
||||
linkedReservations: nullableArrayObjectValidator(
|
||||
linkedReservationSchema
|
||||
),
|
||||
hotelId: z.string(),
|
||||
packages: z.array(packageSchema).default([]),
|
||||
rateDefinition: rateDefinitionSchema,
|
||||
|
||||
@@ -12,5 +12,5 @@ export interface BookingConfirmationRoomsProps
|
||||
mainRoom: Room & {
|
||||
bedType: Room["roomTypes"][number]
|
||||
}
|
||||
linkedReservations?: LinkedReservationSchema[] | null
|
||||
linkedReservations: LinkedReservationSchema[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user