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.

386 B
Raw Blame
import { generateRandomName } from "@/lib/names";
import { Customer, Link } from "@prisma/client";

export interface CustomerWithLink extends Customer {
  link?: Link | null;
}

export const transformCustomer = (customer: CustomerWithLink) => {
  return {
    ...customer,
    name: customer.name || customer.email || generateRandomName(),
    link: customer.link || undefined,
  };
};