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