The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
update commissions API
Kiran Kdb5dbd732fa4
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/use-commission-filters.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/use-commission-filters.tsxindex 6c3f1f6fb1..5ee64d29e3 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/use-commission-filters.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/use-commission-filters.tsx@@ -76,7 +76,7 @@ export function useCommissionFilters() {key: "type",icon: Sliders,label: "Type",- options: ["click", "lead", "sale"].map((slug) => ({+ options: ["click", "lead", "sale", "custom"].map((slug) => ({value: slug,label: capitalize(slug) as string,icon: <CommissionTypeIcon type={slug} />,diff --git a/apps/web/lib/zod/schemas/commissions.ts b/apps/web/lib/zod/schemas/commissions.tsindex 605f3655be..273f7fd3be 100644--- a/apps/web/lib/zod/schemas/commissions.ts+++ b/apps/web/lib/zod/schemas/commissions.ts@@ -6,11 +6,13 @@ import { getPaginationQuerySchema } from "./misc";import { PartnerSchema } from "./partners";import { parseDateSchema } from "./utils";+const CommissionType = z.enum(["click", "lead", "sale", "custom"]);+export const CommissionSchema = z.object({id: z.string().describe("The commission's unique ID on Dub.").openapi({example: "cm_1JVR7XRCSR0EDBAF39FZ4PMYE",}),- type: z.enum(["click", "lead", "sale"]).optional(),+ type: CommissionType.optional(),amount: z.number(),earnings: z.number(),currency: z.string(),@@ -30,7 +32,7 @@ export const CommissionResponseSchema = CommissionSchema.merge(export const getCommissionsQuerySchema = z.object({- type: z.enum(["click", "lead", "sale"]).optional(),+ type: CommissionType.optional(),customerId: z.string().optional()