feat: SW-1589 Obtain bookingCode from booking object via store

This commit is contained in:
Hrishikesh Vaipurkar
2025-03-19 11:01:56 +01:00
parent eb2c4511c2
commit cb5c3bfcef
2 changed files with 2 additions and 4 deletions

View File

@@ -73,7 +73,6 @@ export default function PaymentClient({
const lang = useLang() const lang = useLang()
const intl = useIntl() const intl = useIntl()
const searchParams = useSearchParams() const searchParams = useSearchParams()
const bookingCode = searchParams.get("bookingCode")
const { booking, canProceedToPayment, rooms, totalPrice } = const { booking, canProceedToPayment, rooms, totalPrice } =
useEnterDetailsStore((state) => ({ useEnterDetailsStore((state) => ({
@@ -342,7 +341,7 @@ export default function PaymentClient({
memberPrice: room.roomRate.memberRate?.localPrice.pricePerStay, memberPrice: room.roomRate.memberRate?.localPrice.pricePerStay,
publicPrice: room.roomRate.publicRate?.localPrice.pricePerStay, publicPrice: room.roomRate.publicRate?.localPrice.pricePerStay,
}, },
bookingCode, bookingCode: booking.bookingCode,
roomTypeCode: room.bedType!.roomTypeCode, // A selection has been made in order to get to this step. roomTypeCode: room.bedType!.roomTypeCode, // A selection has been made in order to get to this step.
smsConfirmationRequested: data.smsConfirmation, smsConfirmationRequested: data.smsConfirmation,
specialRequest: { specialRequest: {
@@ -363,7 +362,6 @@ export default function PaymentClient({
rooms, rooms,
booking, booking,
isFlexRate, isFlexRate,
bookingCode,
] ]
) )

View File

@@ -7,7 +7,7 @@ const roomsSchema = z
.array( .array(
z.object({ z.object({
adults: z.number().int().nonnegative(), adults: z.number().int().nonnegative(),
bookingCode: z.string().nullable(), bookingCode: z.string().optional(),
childrenAges: z childrenAges: z
.array( .array(
z.object({ z.object({