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.

Update create-commission.ts

Steven Tey88671f514867
diff --git a/apps/web/lib/actions/partners/create-commission.ts b/apps/web/lib/actions/partners/create-commission.ts
index f3352dfd60..ceab2da9fc 100644
--- a/apps/web/lib/actions/partners/create-commission.ts
+++ b/apps/web/lib/actions/partners/create-commission.ts
@@ -133,17 +133,19 @@ export const createCommissionAction = authActionClient
bot: 0,
qr: 0,
});
- leadEvent = leadEventSchemaTB.parse(clickEvent);
-
const leadEventId = nanoid(16);
+ leadEvent = leadEventSchemaTB.parse({
+ ...clickEvent,
+ event_id: leadEventId,
+ event_name: leadEventName || "Sign up",
+ customer_id: customerId,
+ });
+
shouldUpdateCustomer = !customer.linkId && clickData ? true : false;
await Promise.allSettled([
recordLeadWithTimestamp({
...leadEvent,
- event_id: leadEventId,
- event_name: leadEventName || "Sign up",
- customer_id: customerId,
timestamp: new Date(finalLeadEventDate).toISOString(),
}),