Merged in chore/refactor-trpc-booking-routes (pull request #3510)
feat(BOOK-750): refactor booking endpoints * WIP * wip * wip * parse dates in UTC * wip * no more errors * Merge branch 'master' of bitbucket.org:scandic-swap/web into chore/refactor-trpc-booking-routes * . * cleanup * import named z from zod * fix(BOOK-750): updateBooking api endpoint expects dateOnly, we passed ISO date Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"use client"
|
||||
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { usePathname, useRouter } from "next/navigation"
|
||||
import { useState } from "react"
|
||||
@@ -25,7 +26,7 @@ import ModifyContact from "../ModifyContact"
|
||||
|
||||
import styles from "./guestDetails.module.css"
|
||||
|
||||
import type { Guest } from "@scandic-hotels/trpc/routers/booking/output"
|
||||
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
||||
|
||||
import {
|
||||
type ModifyContactSchema,
|
||||
@@ -34,9 +35,9 @@ import {
|
||||
import { MODAL_STEPS } from "@/types/components/hotelReservation/myStay/myStay"
|
||||
import type { SafeUser } from "@/types/user"
|
||||
|
||||
interface GuestDetailsProps {
|
||||
type GuestDetailsProps = {
|
||||
refId: string
|
||||
guest: Guest
|
||||
guest: BookingConfirmation["booking"]["guest"]
|
||||
isCancelled: boolean
|
||||
user: SafeUser
|
||||
}
|
||||
@@ -76,6 +77,7 @@ export default function GuestDetails({
|
||||
const isFirstStep = currentStep === MODAL_STEPS.INITIAL
|
||||
|
||||
const isMemberBooking =
|
||||
!!user?.membership?.membershipNumber &&
|
||||
guest.membershipNumber === user?.membership?.membershipNumber
|
||||
|
||||
const updateGuest = trpc.booking.update.useMutation({
|
||||
@@ -196,7 +198,7 @@ export default function GuestDetails({
|
||||
{guest.firstName} {guest.lastName}
|
||||
</p>
|
||||
</Typography>
|
||||
{isMemberBooking && user.membership && (
|
||||
{isMemberBooking && user?.membership && (
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<p className={styles.memberNumber} data-hj-suppress>
|
||||
{intl.formatMessage(
|
||||
|
||||
Reference in New Issue
Block a user