Harsh/fix 404 page for undefined events (#5700)
* fix: 404 page for undefined events * Update apps/web/pages/[user]/[type].tsx Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: Guest <guest@pop-os.localdomain> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
This commit is contained in:
co-authored by
Hariom Balhara
Guest
Alex van Andel
parent
a9117c2d36
commit
2b67ea9635
@@ -121,7 +121,7 @@ async function getUserPageProps(context: GetStaticPropsContext) {
|
||||
"strikethrough",
|
||||
]);
|
||||
|
||||
if (!user || !user.eventTypes) return { notFound: true };
|
||||
if (!user || !user.eventTypes.length) return { notFound: true };
|
||||
|
||||
const [eventType]: (typeof user.eventTypes[number] & {
|
||||
users: Pick<User, "name" | "username" | "hideBranding" | "plan" | "timeZone">[];
|
||||
|
||||
Reference in New Issue
Block a user