The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
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,
};
};