Skip to content

Scheduling infrastructure for absolutely everyone.

fix: acme.cal.local crashes due to missing requestedSlug in seed (#14592)

Alex van Andel4daf9db9db5b
diff --git a/apps/web/lib/team/[slug]/getServerSideProps.tsx b/apps/web/lib/team/[slug]/getServerSideProps.tsx
index 18d6df4a5b4..a094a923b7b 100644
--- a/apps/web/lib/team/[slug]/getServerSideProps.tsx
+++ b/apps/web/lib/team/[slug]/getServerSideProps.tsx
@@ -213,6 +213,9 @@ function getTeamWithoutMetadata<T extends Pick<Team, "metadata">>(team: T) {
const teamMetadata = teamMetadataSchema.parse(metadata);
return {
...rest,
- requestedSlug: teamMetadata?.requestedSlug,
+ // add requestedSlug if available.
+ ...(typeof teamMetadata?.requestedSlug !== "undefined"
+ ? { requestedSlug: teamMetadata?.requestedSlug }
+ : {}),
};
}