2
0
Files
cal/calcom/packages/app-store/make/pages/setup/_getServerSideProps.tsx
2024-08-09 00:39:27 +02:00

23 lines
588 B
TypeScript

import type { GetServerSidePropsContext } from "next";
import getAppKeysFromSlug from "../../../_utils/getAppKeysFromSlug";
export interface IMakeSetupProps {
inviteLink: string;
}
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const notFound = { notFound: true } as const;
if (typeof ctx.params?.slug !== "string") return notFound;
let inviteLink = "";
const appKeys = await getAppKeysFromSlug("make");
if (typeof appKeys.invite_link === "string") inviteLink = appKeys.invite_link;
return {
props: {
inviteLink,
},
};
};