Merged in fix/book-607-page-not-found-confirmation-page (pull request #3345)

* fix(BOOK-607): updated to read from base URL env and contentstack slug instead

* made url optional on interface

* added url to findBooking query

* added the correct (new) link in the confirmation header, add to calendar


Approved-by: Erik Tiekstra
This commit is contained in:
Matilda Haneling
2025-12-17 07:53:04 +00:00
parent c796f5bb81
commit b8bc94acb3
7 changed files with 69 additions and 32 deletions

View File

@@ -7,6 +7,7 @@ import { Alert } from "@scandic-hotels/design-system/Alert"
import { Divider } from "@scandic-hotels/design-system/Divider"
import { HotelTypeEnum } from "@scandic-hotels/trpc/enums/hotelType"
import { env } from "../../../env/server"
import { BookingConfirmationProvider } from "../../providers/BookingConfirmationProvider"
import { getBookingConfirmation } from "../../trpc/memoizedRequests/getBookingConfirmation"
import { SidePanel } from "../SidePanel"
@@ -41,7 +42,10 @@ export async function BookingConfirmation({
return notFound()
}
const { booking, hotel, room, roomCategories } = bookingConfirmation
const { booking, url, hotel, room, roomCategories } = bookingConfirmation
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
const hotelUrl = new URL(`${baseUrl}${url}`)
if (!room) {
return notFound()
@@ -69,7 +73,12 @@ export async function BookingConfirmation({
]}
vat={booking.vatPercentage}
>
<Confirmation booking={booking} hotel={hotel} room={room}>
<Confirmation
url={hotelUrl.toString()}
booking={booking}
hotel={hotel}
room={room}
>
<div className={styles.booking}>
{membershipFailedError && (
<Alert
@@ -93,7 +102,7 @@ export async function BookingConfirmation({
/>
<PaymentDetails />
<Divider color="Border/Divider/Subtle" />
<HotelDetails hotel={hotel} />
<HotelDetails url={hotelUrl.toString()} hotel={hotel} />
{validAlerts.map((alert) => (
<div key={alert.id}>
<Alert