pass unit into revenue report
Some checks failed
Create docker images (cloud) / Build, push, and deploy (push) Has been cancelled
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled

This commit is contained in:
Francis Cao 2026-01-20 19:09:23 -08:00
parent cd6a28ea4a
commit 52d9dd2871
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 { websiteId, ...parameters } = params;
const { post, useQuery } = useApi(); const { post, useQuery } = useApi();
const { startDate, endDate, timezone } = useDateParameters(); const { startDate, endDate, timezone, unit } = useDateParameters();
const filters = useFilterParameters(); const filters = useFilterParameters();
return useQuery<T>({ return useQuery<T>({
@ -22,6 +22,7 @@ export function useResultQuery<T = any>(
startDate, startDate,
endDate, endDate,
timezone, timezone,
unit,
...params, ...params,
...filters, ...filters,
}, },
@ -35,6 +36,7 @@ export function useResultQuery<T = any>(
startDate, startDate,
endDate, endDate,
timezone, timezone,
unit,
...parameters, ...parameters,
}, },
}), }),

View file

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