feat(SW-2116): Use refId instead of confirmationNumber
This commit is contained in:
@@ -11,10 +11,10 @@ import {
|
||||
getBookingConfirmation,
|
||||
getProfileSafely,
|
||||
} from "@/lib/trpc/memoizedRequests"
|
||||
import { decrypt } from "@/server/routers/utils/encryption"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
import { getIntl } from "@/i18n"
|
||||
import { parseRefId } from "@/utils/refId"
|
||||
import { isValidSession } from "@/utils/session"
|
||||
|
||||
import AdditionalInfoForm from "../../FindMyBooking/AdditionalInfoForm"
|
||||
@@ -32,18 +32,19 @@ import styles from "./receipt.module.css"
|
||||
import { CurrencyEnum } from "@/types/enums/currency"
|
||||
|
||||
export async function Receipt({ refId }: { refId: string }) {
|
||||
const value = decrypt(refId)
|
||||
if (!value) {
|
||||
const { confirmationNumber, lastName } = parseRefId(refId)
|
||||
|
||||
if (!confirmationNumber) {
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const session = await auth()
|
||||
const isLoggedIn = isValidSession(session)
|
||||
|
||||
const [confirmationNumber, lastName] = value.split(",")
|
||||
const bv = cookies().get("bv")?.value
|
||||
let bookingConfirmation
|
||||
if (isLoggedIn) {
|
||||
bookingConfirmation = await getBookingConfirmation(confirmationNumber)
|
||||
bookingConfirmation = await getBookingConfirmation(refId)
|
||||
} else if (bv) {
|
||||
const params = new URLSearchParams(bv)
|
||||
const firstName = params.get("firstName")
|
||||
|
||||
Reference in New Issue
Block a user