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.

order links by sale, leads, and clicks

Steven Tey6a8f6c4de760
diff --git a/apps/web/lib/embed/referrals/auth.ts b/apps/web/lib/embed/referrals/auth.ts
index 04fc5916cb..1e154844e5 100644
--- a/apps/web/lib/embed/referrals/auth.ts
+++ b/apps/web/lib/embed/referrals/auth.ts
@@ -83,7 +83,19 @@ export const withReferralsEmbedToken = (
partnerId_programId: { partnerId, programId },
},
include: {
- links: true,
+ links: {
+ orderBy: [
+ {
+ saleAmount: "desc",
+ },
+ {
+ leads: "desc",
+ },
+ {
+ clicks: "desc",
+ },
+ ],
+ },
program: true,
},
});