From 895a5ad39afabfc9c5f1d309031d17b912860f45 Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Tue, 26 Sep 2023 14:13:09 +0700 Subject: [PATCH] fix: typecheck errors --- .../app-store/alby/pages/setup/_getServerSideProps.tsx | 7 +++++-- packages/app-store/make/pages/setup/index.tsx | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/app-store/alby/pages/setup/_getServerSideProps.tsx b/packages/app-store/alby/pages/setup/_getServerSideProps.tsx index 23001de184..f704f342c7 100644 --- a/packages/app-store/alby/pages/setup/_getServerSideProps.tsx +++ b/packages/app-store/alby/pages/setup/_getServerSideProps.tsx @@ -11,7 +11,7 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => { const session = await getServerSession({ req, res }); if (!session?.user?.id) { - return res.status(401).json({ message: "You must be logged in to do this" }); + return res.writeHead(401).end(); } const credentials = await prisma.credential.findFirst({ @@ -26,7 +26,10 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => { lightningAddress: null, }; if (credentials?.key) { - const { account_lightning_address, account_email } = credentials.key; + const { account_lightning_address, account_email } = credentials.key as { + account_lightning_address?: string; + account_email?: string; + }; if (account_lightning_address) { props.lightningAddress = account_lightning_address; } diff --git a/packages/app-store/make/pages/setup/index.tsx b/packages/app-store/make/pages/setup/index.tsx index 73ccd84c6f..5b6c28bffb 100644 --- a/packages/app-store/make/pages/setup/index.tsx +++ b/packages/app-store/make/pages/setup/index.tsx @@ -1,4 +1,4 @@ -import type { InferGetStaticPropsType } from "next"; +import type { InferGetServerSidePropsType } from "next"; import { Trans } from "next-i18next"; import Link from "next/link"; import { useState } from "react"; @@ -9,11 +9,11 @@ import { trpc } from "@calcom/trpc/react"; import { Button, Tooltip, showToast } from "@calcom/ui"; import { Clipboard } from "@calcom/ui/components/icon"; -import type { getStaticProps } from "./_getStaticProps"; +import type { getServerSideProps } from "./_getServerSideProps"; const MAKE = "make"; -export default function MakeSetup({ inviteLink }: InferGetStaticPropsType) { +export default function MakeSetup({ inviteLink }: InferGetServerSidePropsType) { const [newApiKeys, setNewApiKeys] = useState>({}); const { t } = useLocale();