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 Kbbfbc54c4e02
diff --git a/apps/web/lib/actions/partners/create-commission.ts b/apps/web/lib/actions/partners/create-commission.ts
index 6c60824581..b2694e3fe6 100644
--- a/apps/web/lib/actions/partners/create-commission.ts
+++ b/apps/web/lib/actions/partners/create-commission.ts
@@ -83,6 +83,7 @@ export const createCommissionAction = authActionClient
const shouldRecordSale = saleAmount && saleDate;
let clickData: any;
+ // Record click
if (shouldRecordClick) {
const dummyRequest = new Request(link.url, {
headers: new Headers({
@@ -119,6 +120,7 @@ export const createCommissionAction = authActionClient
clickData = clickEvent.data[0];
}
+ // Record lead
if (shouldRecordLead) {
const clickEvent = clickEventSchemaTB.parse({
...clickData,
@@ -160,6 +162,7 @@ export const createCommissionAction = authActionClient
});
}
+ // Record sale
if (shouldRecordSale) {
const clickEvent = clickEventSchemaTB.parse({
...clickData,