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.

Hide link sale amounts in the partner programs list

Rafi578db40dfa8b
diff --git a/apps/web/app/(ee)/api/partner-profile/programs/route.ts b/apps/web/app/(ee)/api/partner-profile/programs/route.ts
index d2a5406a1a..3b6f406834 100644
--- a/apps/web/app/(ee)/api/partner-profile/programs/route.ts
+++ b/apps/web/app/(ee)/api/partner-profile/programs/route.ts
@@ -1,6 +1,7 @@
import { getProgramEnrollmentInactiveDates } from "@/lib/api/partner-profile/get-program-enrollment-inactive-dates";
import { getProgramEnrollmentsWhere } from "@/lib/api/partner-profile/get-program-enrollments-where";
import { withPartnerProfile } from "@/lib/auth/partner";
+import { hidePartnerSaleAmount } from "@/lib/partners/hide-partner-revenue";
import { prisma } from "@/lib/prisma";
import {
PartnerProfileProgramEnrollmentSchema,
@@ -68,6 +69,11 @@ export const GET = withPartnerProfile(async ({ partner, searchParams }) => {
program: {
select: PROGRAM_SELECT,
},
+ partnerGroup: {
+ select: {
+ revenueDataSharingDisabledAt: true,
+ },
+ },
application: {
select: {
rejectionReason: true,
@@ -116,6 +122,9 @@ export const GET = withPartnerProfile(async ({ partner, searchParams }) => {
const response = programEnrollments.map((enrollment) => {
return {
...enrollment,
+ links: enrollment.links.map((link) =>
+ hidePartnerSaleAmount(link, enrollment.partnerGroup),
+ ),
inactiveAt: inactiveDates.get(enrollment.programId) ?? null,
rewards: includeRewardsDiscounts
? [