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.

remove timestamp from lead data because tinybird will generate its own at ingestion time

Steven Teya2bbea7aa5d4
diff --git a/apps/web/app/api/stripe/integration/webhook/customer-created.ts b/apps/web/app/api/stripe/integration/webhook/customer-created.ts
index 96cf728d44..8ae7ebdd32 100644
--- a/apps/web/app/api/stripe/integration/webhook/customer-created.ts
+++ b/apps/web/app/api/stripe/integration/webhook/customer-created.ts
@@ -74,8 +74,10 @@ export async function customerCreated(event: Stripe.Event) {
},
});
+ const { timestamp, ...rest } = clickData;
+
const leadData = {
- ...clickData,
+ ...rest, // remove timestamp from lead data because tinybird will generate its own at ingestion time
event_id: nanoid(16),
event_name: "New customer",
customer_id: customer.id,
@@ -83,9 +85,7 @@ export async function customerCreated(event: Stripe.Event) {
const [_lead, _link, workspace] = await Promise.all([
// Record lead
- recordLead({
- ...leadData,
- }),
+ recordLead(leadData),
// update link leads count
prisma.link.update({