fix redirect to upcoming booking (#3129)

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
pull/3133/head
Carina Wollendorfer 2022-06-21 16:57:04 +02:00 committed by GitHub
parent 993bd18a73
commit d7cd6e011e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@ export default function CancelSuccess() {
const { title, name, eventPage, recurring } = router.query;
let team: string | string[] | number | undefined = router.query.team;
const { data: session, status } = useSession();
const isRecurringEvent = recurring === "true" ? true : false;
const loading = status === "loading";
// If team param passed wrongly just assume it be a non team case.
if (team instanceof Array || typeof team === "undefined") {
@ -63,7 +64,7 @@ export default function CancelSuccess() {
{!loading && session?.user && (
<Button
data-testid="back-to-bookings"
href={recurring !== "" ? "/bookings/recurring" : "/bookings"}
href={isRecurringEvent ? "/bookings/recurring" : "/bookings"}
StartIcon={ArrowLeftIcon}>
{t("back_to_bookings")}
</Button>