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 default intervals

Steven Tey77b5cfc527cb
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/sales/sale-table.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/sales/sale-table.tsx
index 8f06bb5f74..a3e0f35fbf 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/sales/sale-table.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/sales/sale-table.tsx
@@ -214,7 +214,10 @@ const SaleTableBusinessInner = memo(
onSearchChange={setSearch}
onSelectedFilterChange={setSelectedFilter}
/>
- <SimpleDateRangePicker className="w-full sm:min-w-[200px] md:w-fit" />
+ <SimpleDateRangePicker
+ className="w-full sm:min-w-[200px] md:w-fit"
+ defaultInterval="all"
+ />
</div>
<AnimatedSizeContainer height>
<div>
diff --git a/apps/web/lib/zod/schemas/program-sales.ts b/apps/web/lib/zod/schemas/program-sales.ts
index fbd3700189..04b0017634 100644
--- a/apps/web/lib/zod/schemas/program-sales.ts
+++ b/apps/web/lib/zod/schemas/program-sales.ts
@@ -1,7 +1,4 @@
-import {
- DUB_PARTNERS_ANALYTICS_INTERVAL,
- intervals,
-} from "@/lib/analytics/constants";
+import { intervals } from "@/lib/analytics/constants";
import { CommissionStatus } from "@dub/prisma/client";
import { z } from "zod";
import { CustomerSchema } from "./customers";
@@ -31,7 +28,7 @@ export const getProgramSalesQuerySchema = z
status: z.nativeEnum(CommissionStatus).optional(),
sortBy: z.enum(["createdAt", "amount"]).default("createdAt"),
sortOrder: z.enum(["asc", "desc"]).default("desc"),
- interval: z.enum(intervals).default(DUB_PARTNERS_ANALYTICS_INTERVAL),
+ interval: z.enum(intervals).default("all"),
start: parseDateSchema.optional(),
end: parseDateSchema.optional(),
customerId: z.string().optional(),