diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/gla-payment-callback/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/gla-payment-callback/page.tsx index 04e1a916d..fa59294f6 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/gla-payment-callback/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/gla-payment-callback/page.tsx @@ -24,7 +24,7 @@ export default async function GuaranteePaymentCallbackPage({ const status = searchParams.status const confirmationNumber = searchParams.confirmationNumber const refId = searchParams.refId - const myStayUrl = `${hotelreservation(lang)}/my-stay/${encodeURIComponent(refId)}` + const myStayUrl = `${hotelreservation(lang)}/my-stay?RefId=${refId}` if (status === "success" && confirmationNumber && refId) { console.log(`[gla-payment-callback] redirecting to: ${myStayUrl}`) diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/loading.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/loading.tsx deleted file mode 100644 index 92ff5739e..000000000 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/loading.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import LoadingSpinner from "@/components/LoadingSpinner" - -export default function Loading() { - return -} diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/layout.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/layout.tsx similarity index 100% rename from apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/layout.tsx rename to apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/layout.tsx diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/loading.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/loading.tsx new file mode 100644 index 000000000..bae8bb797 --- /dev/null +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/loading.tsx @@ -0,0 +1 @@ +export { MyStaySkeleton as default } from "@/components/HotelReservation/MyStay/myStaySkeleton" diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/page.tsx similarity index 64% rename from apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/page.tsx rename to apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/page.tsx index 10e5568a8..e7fb606a3 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/page.tsx @@ -1,3 +1,4 @@ +import { notFound } from "next/navigation" import { Suspense } from "react" import { MyStay } from "@/components/HotelReservation/MyStay" @@ -6,11 +7,15 @@ import { MyStaySkeleton } from "@/components/HotelReservation/MyStay/myStaySkele import type { LangParams, PageArgs } from "@/types/params" export default async function MyStayPage({ - params, -}: PageArgs) { + searchParams, +}: PageArgs) { + if (!searchParams.RefId) { + notFound() + } + return ( }> - + ) } diff --git a/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx b/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx index b22b61c7e..94d82a8d6 100644 --- a/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx +++ b/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx @@ -6,6 +6,7 @@ import { FormProvider, useForm } from "react-hook-form" import { useIntl } from "react-intl" import { customerService } from "@/constants/currentWebHrefs" +import { hotelreservation } from "@/constants/routes/hotelReservation" import { trpc } from "@/lib/trpc/client" import Button from "@/components/TempDesignSystem/Button" @@ -43,9 +44,7 @@ export default function FindMyBooking() { const values = form.getValues() const value = new URLSearchParams(values).toString() document.cookie = `bv=${encodeURIComponent(value)}; Path=/; Max-Age=600; Secure; SameSite=Strict` - router.push( - `/${lang}/hotelreservation/my-stay/${encodeURIComponent(result.refId)}` - ) + router.push(`${hotelreservation(lang)}/my-stay?RefId=${result.refId}`) }, onError: (error) => { console.error("Failed to create ref id", error)