From 4212e6d61908face52d647bb661d71db959cf864 Mon Sep 17 00:00:00 2001 From: zomars Date: Tue, 26 Jul 2022 17:11:37 -0600 Subject: [PATCH] Booking fixes attempt --- apps/web/components/Shell.tsx | 9 +++------ apps/web/pages/bookings/index.tsx | 18 ------------------ packages/prisma/zod-utils.ts | 2 +- 3 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 apps/web/pages/bookings/index.tsx diff --git a/apps/web/components/Shell.tsx b/apps/web/components/Shell.tsx index 3e32ced9b4..fba57f1b42 100644 --- a/apps/web/components/Shell.tsx +++ b/apps/web/components/Shell.tsx @@ -125,12 +125,9 @@ const Layout = ({ }: LayoutProps & { status: SessionContextValue["status"]; plan?: UserPlan; isLoading: boolean }) => { const isEmbed = useIsEmbed(); const router = useRouter(); - const { data: routingForms } = trpc.useQuery([ - "viewer.appById", - { - appId: "routing_forms", - }, - ]); + const { data: routingForms } = trpc.useQuery(["viewer.appById", { appId: "routing_forms" }], { + enabled: status === "authenticated", + }); const { t } = useLocale(); const navigation = [ diff --git a/apps/web/pages/bookings/index.tsx b/apps/web/pages/bookings/index.tsx deleted file mode 100644 index 3dcf15eb16..0000000000 --- a/apps/web/pages/bookings/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { NextPageContext } from "next"; - -import { getSession } from "@lib/auth"; - -function RedirectPage() { - return null; -} - -export async function getServerSideProps(context: NextPageContext) { - const session = await getSession(context); - if (!session?.user?.id) { - return { redirect: { permanent: false, destination: "/auth/login" } }; - } - - return { redirect: { permanent: false, destination: "/bookings/upcoming" } }; -} - -export default RedirectPage; diff --git a/packages/prisma/zod-utils.ts b/packages/prisma/zod-utils.ts index d2ae938d60..b97800d353 100644 --- a/packages/prisma/zod-utils.ts +++ b/packages/prisma/zod-utils.ts @@ -1,6 +1,6 @@ import { z } from "zod"; -import { LocationType } from "@calcom/core/location"; +import { LocationType } from "@calcom/app-store/locations"; import dayjs from "@calcom/dayjs"; import { slugify } from "@calcom/lib/slugify";