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.

fix build

Kiran K7b9406ef1038
diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.ts
index 4bb61618c8..875288307b 100644
--- a/apps/web/lib/types.ts
+++ b/apps/web/lib/types.ts
@@ -49,7 +49,7 @@ import {
import { createOAuthAppSchema, oAuthAppSchema } from "./zod/schemas/oauth";
import {
createPartnerSchema,
- EnrolledPartnerBasicSchema,
+ EnrolledPartnerSchemaExtended,
PartnerSchema,
} from "./zod/schemas/partners";
import {
@@ -411,7 +411,9 @@ export type PartnerProfileCustomerProps = z.infer<
export type PartnerProfileLinkProps = z.infer<typeof PartnerProfileLinkSchema>;
-export type EnrolledPartnerProps = z.infer<typeof EnrolledPartnerBasicSchema>;
+export type EnrolledPartnerProps = z.infer<
+ typeof EnrolledPartnerSchemaExtended
+>;
export type DiscountProps = z.infer<typeof DiscountSchema>;
diff --git a/apps/web/lib/zod/schemas/partners.ts b/apps/web/lib/zod/schemas/partners.ts
index 5c003d2df9..7de16c1842 100644
--- a/apps/web/lib/zod/schemas/partners.ts
+++ b/apps/web/lib/zod/schemas/partners.ts
@@ -363,6 +363,18 @@ export const EnrolledPartnerBasicSchema = PartnerSchema.pick({
.nullish(),
});
+export const EnrolledPartnerSchemaExtended = EnrolledPartnerBasicSchema.merge(
+ EnrolledPartnerSchema.pick({
+ clicks: true,
+ leads: true,
+ sales: true,
+ saleAmount: true,
+ totalCommissions: true,
+ netRevenue: true,
+ earnings: true,
+ }),
+);
+
export const LeaderboardPartnerSchema = z.object({
id: z.string(),
name: z.string(),
diff --git a/apps/web/scripts/cal/backfill-referral-links.ts b/apps/web/scripts/cal/backfill-referral-links.ts
index 0781538b3e..339524803f 100644
--- a/apps/web/scripts/cal/backfill-referral-links.ts
+++ b/apps/web/scripts/cal/backfill-referral-links.ts
@@ -1,5 +1,3 @@
-// @ts-nocheck
-
import { prisma } from "@dub/prisma";
import "dotenv-flow/config";
import * as fs from "fs";