fix: typecheck errors
parent
d2b2af71b1
commit
895a5ad39a
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<typeof getStaticProps>) {
|
||||
export default function MakeSetup({ inviteLink }: InferGetServerSidePropsType<typeof getServerSideProps>) {
|
||||
const [newApiKeys, setNewApiKeys] = useState<Record<string, string>>({});
|
||||
|
||||
const { t } = useLocale();
|
||||
|
|
Loading…
Reference in New Issue