Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

646 B
Raw Blame
import { prisma } from "@/lib/prisma";
import { cache } from "react";

export const getDashboard = cache(async ({ id }: { id: string }) => {
  return await prisma.dashboard.findUnique({
    where: {
      id,
    },
    select: {
      id: true,
      doIndex: true,
      password: true,
      showConversions: true,
      link: {
        select: {
          id: true,
          domain: true,
          key: true,
          url: true,
        },
      },
      folder: {
        select: {
          id: true,
          name: true,
        },
      },
      project: {
        select: {
          plan: true,
        },
      },
    },
  });
});