Made filters work for all reports.

This commit is contained in:
Mike Cao 2025-06-29 23:57:11 -07:00
parent ea83afbc13
commit 8b64029409
46 changed files with 328 additions and 275 deletions

View file

@ -9,7 +9,7 @@ export function useResultQuery<T>(
) {
const { websiteId } = params;
const { post, useQuery } = useApi();
const filterParams = useFilterParams(websiteId);
const filters = useFilterParams(websiteId);
return useQuery<T>({
queryKey: [
@ -17,11 +17,11 @@ export function useResultQuery<T>(
{
type,
websiteId,
...filterParams,
...filters,
...params,
},
],
queryFn: () => post(`/reports/${type}`, { type, ...filterParams, ...params }),
queryFn: () => post(`/reports/${type}`, { type, ...filters, ...params }),
enabled: !!type,
...options,
});