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

Kiran K4949d128ef7a
diff --git a/apps/web/lib/actions/partners/create-manual-payout.ts b/apps/web/lib/actions/partners/create-manual-payout.ts
index e6a52f16c6..2b08cef770 100644
--- a/apps/web/lib/actions/partners/create-manual-payout.ts
+++ b/apps/web/lib/actions/partners/create-manual-payout.ts
@@ -38,12 +38,17 @@ export const createManualPayoutAction = authActionClient
},
},
select: {
- linkId: true,
+ partnerId: true,
+ _count: {
+ select: {
+ links: true,
+ },
+ },
},
}),
]);
- if (!programEnrollment.linkId) {
+ if (!programEnrollment._count.links) {
throw new Error("No short link found for this partner in this program.");
}
@@ -51,7 +56,7 @@ export const createManualPayoutAction = authActionClient
if (type === "clicks" || type === "leads") {
const count = await getAnalytics({
- linkId: programEnrollment.linkId,
+ partnerId: programEnrollment.partnerId,
event: type,
groupBy: "count",
start,