hunk.code_window:             </Link>
             </span>
           )}
           {typeof window !== "undefined" && profile?.slug && (
             <Link href={profile.slug}>
               <a className="block text-xs text-neutral-500">{`cal.com/${profile.slug}`}</a>
             </Link>
           )}
  
hunk.labels: keep keep keep replace replace keep keep keep
hunk.after_edit:         {profile?.slug && (
             <Link href={`/${profile.slug}`}>
  
hunk.file_path: pages/event-types/index.tsx
hunk.type: replace
file: import type { NextApiRequest, NextApiResponse } from "next";
  
  import { getSession } from "@lib/auth";
  import prisma from "@lib/prisma";
  import { defaultAvatarSrc } from "@lib/profile";
  
  export default async function handler(req: NextApiRequest, res: NextApiResponse) {
    const session = await getSession({ req: req });
    if (!session) {
      res.status(401).json({ message: "Not authenticated" });
      return;
    }
  
    const user: User = await prisma.user.findUnique({
      where: {
        id: session.user.id,
      },
      select: {
        id: true,
        username: true,
        name: true,
        email: true,
        bio: true,
        timeZone: true,
        weekStart: true,
        startTime: true,
        endTime: true,
        bufferTime: true,
        theme: true,
        createdDate: true,
        hideBranding: true,
        avatar: true,
      },
    });
  
    user.avatar = user.avatar || defaultAvatarSrc({ email: user.email });
  
    res.status(200).json({
      user,
    });
  }
  