pass unit into revenue report

This commit is contained in:
Francis Cao 2026-01-20 19:09:23 -08:00
parent 3a498333a6
commit 52f812d9e5
2 changed files with 4 additions and 1 deletions

View file

@ -10,7 +10,7 @@ export function useResultQuery<T = any>(
) {
const { websiteId, ...parameters } = params;
const { post, useQuery } = useApi();
const { startDate, endDate, timezone } = useDateParameters();
const { startDate, endDate, timezone, unit } = useDateParameters();
const filters = useFilterParameters();
return useQuery<T>({
@ -22,6 +22,7 @@ export function useResultQuery<T = any>(
startDate,
endDate,
timezone,
unit,
...params,
...filters,
},
@ -35,6 +36,7 @@ export function useResultQuery<T = any>(
startDate,
endDate,
timezone,
unit,
...parameters,
},
}),

View file

@ -174,6 +174,7 @@ export const revenueReportSchema = z.object({
parameters: z.object({
startDate: z.coerce.date(),
endDate: z.coerce.date(),
unit: unitParam.optional(),
timezone: z.string().optional(),
currency: z.string(),
}),