import Head from 'next/head' import Link from 'next/link' import prisma from '../lib/prisma' import { useRouter } from 'next/router' const dayjs = require('dayjs') export default function Success(props) { const router = useRouter() const { date } = router.query return(
Booking Confirmed | {props.eventType.title} with {props.user.name || props.user.username} | Calendso
) } export async function getServerSideProps(context) { const user = await prisma.user.findFirst({ where: { username: context.query.user, }, select: { username: true, name: true, bio: true, avatar: true, eventTypes: true } }); const eventType = await prisma.eventType.findUnique({ where: { id: parseInt(context.query.type), }, select: { id: true, title: true, description: true, length: true } }); return { props: { user, eventType }, } }