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

Kiran K1e1688f3eeaf
diff --git a/apps/web/lib/actions/partners/create-commission.ts b/apps/web/lib/actions/partners/create-commission.ts
index 7c227293ac..f21fabbf67 100644
--- a/apps/web/lib/actions/partners/create-commission.ts
+++ b/apps/web/lib/actions/partners/create-commission.ts
@@ -124,8 +124,18 @@ export const createCommissionAction = authActionClient
timestamp: new Date(leadDate!).toISOString(),
});
- // TODO:
- // Should we update the linkId, clickId, and clickedAt? for the customer?
+ if (!customer.linkId && clickData) {
+ await prisma.customer.update({
+ where: {
+ id: customerId,
+ },
+ data: {
+ linkId,
+ clickId: clickData.click_id,
+ clickedAt: clickData.timestamp,
+ },
+ });
+ }
await createPartnerCommission({
event: "lead",