The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
account for null customer name in transformCustomer
Steven Tey3e5780a0e788
diff --git a/apps/web/lib/api/customers/transform-customer.ts b/apps/web/lib/api/customers/transform-customer.tsindex 6fd2f3c882..760613636c 100644--- a/apps/web/lib/api/customers/transform-customer.ts+++ b/apps/web/lib/api/customers/transform-customer.ts@@ -1,3 +1,4 @@+import { generateRandomName } from "@/lib/names";import {Customer,Discount,@@ -23,6 +24,7 @@ export const transformCustomer = (customer: CustomerWithLink) => {const programEnrollment = customer.link?.programEnrollment;return {...customer,+ name: customer.name || customer.email || generateRandomName(),link: customer.link || undefined,partner: programEnrollment?.partner || undefined,discount: programEnrollment?.discount || undefined,