diff --git a/apps/web/pages/cancel/success.tsx b/apps/web/pages/cancel/success.tsx index aac0e15559..34c7d47be5 100644 --- a/apps/web/pages/cancel/success.tsx +++ b/apps/web/pages/cancel/success.tsx @@ -13,8 +13,17 @@ export default function CancelSuccess() { // Get router variables const router = useRouter(); const { title, name, eventPage, recurring } = router.query; + let team: string | string[] | number | undefined = router.query.team; const { data: session, status } = useSession(); const loading = status === "loading"; + // If team param passed wrongly just assume it be a non team case. + if (team instanceof Array || typeof team === "undefined") { + team = 0; + } + const isTeamEvent = +team === 1; + // FIXME: In case of Dynamic Event Booking, it takes the booker to one of the user's page(e.g. A) in the dynamic group(A+B+...). Booker should be taken to the same dynamic group + // This isn't directly possible because a booking doesn't know if it was done for a Dynamic Event(booking.eventType is null) + const eventUrl = `/${isTeamEvent ? "team/" : ""}${eventPage as string}`; return (
- {!loading && !session?.user && } + {!loading && !session?.user && } {!loading && session?.user && (