Skip to content

Commit f903209

Browse files
committed
update sortBy for getPartnerCustomersQuerySchema
1 parent 42237b5 commit f903209

3 files changed

Lines changed: 4 additions & 31 deletions

File tree

apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/(index)/page-client.tsx

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ import {
2020
useTable,
2121
} from "@dub/ui";
2222
import { User } from "@dub/ui/icons";
23-
import {
24-
COUNTRIES,
25-
currencyFormatter,
26-
formatDate,
27-
getApexDomain,
28-
getPrettyUrl,
29-
} from "@dub/utils";
23+
import { COUNTRIES, formatDate, getApexDomain, getPrettyUrl } from "@dub/utils";
3024
import { useParams, useRouter } from "next/navigation";
3125
import { useMemo } from "react";
3226
import { usePartnerCustomerFilters } from "./use-partner-customer-filters";
@@ -64,7 +58,6 @@ export function ProgramCustomersPageClient() {
6458
"customer",
6559
"country",
6660
"link",
67-
"saleAmount",
6861
"createdAt",
6962
"firstSaleAt",
7063
"subscriptionCanceledAt",
@@ -73,7 +66,6 @@ export function ProgramCustomersPageClient() {
7366
"customer",
7467
"country",
7568
"link",
76-
"saleAmount",
7769
"createdAt",
7870
"firstSaleAt",
7971
"subscriptionCanceledAt",
@@ -149,25 +141,6 @@ export function ProgramCustomersPageClient() {
149141
),
150142
size: 250,
151143
},
152-
{
153-
id: "saleAmount",
154-
header: "LTV",
155-
meta: {
156-
headerTooltip:
157-
"The total amount of revenue the customer has generated over time (lifetime value).",
158-
},
159-
accessorKey: "activity.saleAmount",
160-
cell: ({ getValue }) => (
161-
<div className="flex items-center gap-2">
162-
<span>
163-
{currencyFormatter(getValue() ?? 0, {
164-
trailingZeroDisplay: "stripIfInteger",
165-
})}
166-
</span>
167-
<span className="text-neutral-400">USD</span>
168-
</div>
169-
),
170-
},
171144
{
172145
id: "createdAt",
173146
header: "Created",
@@ -270,7 +243,7 @@ export function ProgramCustomersPageClient() {
270243
onPaginationChange: setPagination,
271244
columnVisibility,
272245
onColumnVisibilityChange: setColumnVisibility,
273-
sortableColumns: ["saleAmount", "createdAt"],
246+
sortableColumns: ["createdAt", "firstSaleAt", "subscriptionCanceledAt"],
274247
sortBy,
275248
sortOrder,
276249
onSortChange: ({ sortBy, sortOrder }) =>

apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/partner-stats.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function PartnerStats({
5757
? "-"
5858
: undefined,
5959
href: partner?.id
60-
? `/${slug}/events?event=sales&partnerId=${partner.id}&interval=1y`
60+
? `/${slug}/events?event=sales&partnerId=${partner.id}&interval=1y&saleType=new`
6161
: undefined,
6262
},
6363
{

apps/web/lib/zod/schemas/partner-profile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export const getPartnerCustomersQuerySchema = z
247247
"A filter on the list based on the customer's `linkId` field (the referral link ID).",
248248
),
249249
sortBy: z
250-
.enum(["createdAt", "saleAmount"])
250+
.enum(["createdAt", "firstSaleAt", "subscriptionCanceledAt"])
251251
.optional()
252252
.default("createdAt")
253253
.describe(

0 commit comments

Comments
 (0)