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-earnings.ts

Kiran K1608e72dc806
diff --git a/apps/web/lib/api/earnings/create-earnings.ts b/apps/web/lib/api/earnings/create-earnings.ts
index 7f7a011fd5..e03a676a12 100644
--- a/apps/web/lib/api/earnings/create-earnings.ts
+++ b/apps/web/lib/api/earnings/create-earnings.ts
@@ -42,6 +42,7 @@ export const prepareEarnings = ({
}: CreateEarnings) => {
const amount = click?.amount || sale?.amount;
const invoiceId = sale?.invoiceId;
+ const currency = sale?.currency || "usd";
const quantity = ["lead", "sale"].includes(event.type)
? 1
: click?.quantity || 0;
@@ -62,6 +63,7 @@ export const prepareEarnings = ({
programId: program.id,
partnerId: partner.partnerId,
quantity,
+ currency,
...(amount && { amount }),
...(earnings && { earnings }),
...(invoiceId && { invoiceId }),