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-manual-commission.ts

Kiran K45c63a299cfe
diff --git a/apps/web/lib/actions/partners/create-manual-commission.ts b/apps/web/lib/actions/partners/create-manual-commission.ts
index 98895daba9..df6ea0d1d7 100644
--- a/apps/web/lib/actions/partners/create-manual-commission.ts
+++ b/apps/web/lib/actions/partners/create-manual-commission.ts
@@ -302,7 +302,7 @@ export const createManualCommissionAction = authActionClient
// Duplicate the customer events
const shouldDuplicateEvents =
- eventIds && eventIds.length > 0 && customer.linkId !== linkId;
+ eventIds && eventIds.length > 0 && shouldCreateNewCustomer;
if (shouldDuplicateEvents) {
const eventType = !saleAmount ? "leads" : "sales";
@@ -335,6 +335,8 @@ export const createManualCommissionAction = authActionClient
throw new Error("Selected events not found.");
}
+ console.log(events);
+
// Duplicate the events for the new customer
if (eventType === "leads") {
await Promise.all(