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.

support custom commission partner payout details

Steven Tey5ef12d0c4245
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/settings/payouts/payout-details-sheet.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/settings/payouts/payout-details-sheet.tsx
index f8cf5ef546..f2efd5e706 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/settings/payouts/payout-details-sheet.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/settings/payouts/payout-details-sheet.tsx
@@ -118,9 +118,12 @@ function PayoutDetailsSheetContent({ payout }: PayoutDetailsSheetProps) {
header: "Details",
cell: ({ row }) => (
<div className="flex items-center gap-2">
- {row.original.type === "click" ? (
+ {["click", "custom"].includes(row.original.type) ? (
<div className="flex size-6 items-center justify-center rounded-full bg-neutral-100">
- <CommissionTypeIcon type="click" className="size-4" />
+ <CommissionTypeIcon
+ type={row.original.type}
+ className="size-4"
+ />
</div>
) : (
<img
@@ -137,7 +140,9 @@ function PayoutDetailsSheetContent({ payout }: PayoutDetailsSheetProps) {
<span className="text-sm text-neutral-700">
{row.original.type === "click"
? `${row.original.quantity} ${pluralize("click", row.original.quantity)}`
- : row.original.customer.email || row.original.customer.name}
+ : row.original.customer
+ ? row.original.customer.email || row.original.customer.name
+ : "Custom commission"}
</span>
<span className="text-xs text-neutral-500">
{formatDateTime(row.original.createdAt)}
diff --git a/apps/web/app/api/folders/route.ts b/apps/web/app/api/folders/route.ts
index 5ea5243f91..5547b583c8 100644
--- a/apps/web/app/api/folders/route.ts
+++ b/apps/web/app/api/folders/route.ts
@@ -19,8 +19,6 @@ export const GET = withWorkspace(
const { search, pageSize, page } =
listFoldersQuerySchema.parse(searchParams);
- console.log({ search, pageSize, page });
-
const folders = await getFolders({
workspaceId: workspace.id,
userId: session.user.id,
diff --git a/apps/web/lib/zod/schemas/partner-profile.ts b/apps/web/lib/zod/schemas/partner-profile.ts
index a2ca124805..aa7e4cada3 100644
--- a/apps/web/lib/zod/schemas/partner-profile.ts
+++ b/apps/web/lib/zod/schemas/partner-profile.ts
@@ -29,7 +29,7 @@ export const PartnerEarningsSchema = CommissionSchema.merge(
id: true,
shortLink: true,
url: true,
- }),
+ }).nullish(),
}),
);