The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Return the partner link title only from partner-profile earnings
Rafi15916094d011
diff --git a/apps/web/app/(ee)/api/partner-profile/earnings/route.ts b/apps/web/app/(ee)/api/partner-profile/earnings/route.tsindex e49ff283b6..cb4086818d 100644--- a/apps/web/app/(ee)/api/partner-profile/earnings/route.ts+++ b/apps/web/app/(ee)/api/partner-profile/earnings/route.ts@@ -18,6 +18,7 @@ export const GET = withPartnerProfile(async ({ partner, searchParams }) => {...filters,programId,partnerId: partner.id,+ includePartnerLinkTitle: true,});return NextResponse.json(earnings);diff --git a/apps/web/lib/api/partner-profile/get-earnings-for-partner.ts b/apps/web/lib/api/partner-profile/get-earnings-for-partner.tsindex 5acbb04711..f015d49579 100644--- a/apps/web/lib/api/partner-profile/get-earnings-for-partner.ts+++ b/apps/web/lib/api/partner-profile/get-earnings-for-partner.ts@@ -17,6 +17,7 @@ interface GetEarningsForPartnerParamsextends z.infer<typeof getPartnerEarningsQuerySchema> {partnerId: string;programId?: string; // if not provided, earnings across all programs (except the network program) are returned+ includePartnerLinkTitle?: boolean; // only for partner-profile routes, because the workspace creates embed tokens}export async function getEarningsForPartner(@@ -40,6 +41,7 @@ export async function getEarningsForPartner(timezone,programId,partnerId,+ includePartnerLinkTitle = false,} = params;const { startDate, endDate } = getStartEndDates({@@ -122,11 +124,13 @@ export async function getEarningsForPartner(id: true,shortLink: true,url: true,- partnerLinkDetails: {- select: {- title: true,+ ...(includePartnerLinkTitle && {+ partnerLinkDetails: {+ select: {+ title: true,+ },},- },+ }),},},program: {@@ -196,7 +200,9 @@ export async function getEarningsForPartner(id: e.link.id,shortLink: e.link.shortLink,url: e.link.url,- partnerLinkTitle: e.link.partnerLinkDetails?.title ?? null,+ ...(includePartnerLinkTitle && {+ partnerLinkTitle: e.link.partnerLinkDetails?.title ?? null,+ }),}: e.link,customer: e.customer