mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Made filters work for all reports.
This commit is contained in:
parent
ea83afbc13
commit
8b64029409
46 changed files with 328 additions and 275 deletions
|
|
@ -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,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ export function useFilterParams(websiteId: string) {
|
|||
city,
|
||||
event,
|
||||
tag,
|
||||
hostname,
|
||||
},
|
||||
} = useNavigation();
|
||||
|
||||
|
|
@ -42,5 +43,6 @@ export function useFilterParams(websiteId: string) {
|
|||
city,
|
||||
event,
|
||||
tag,
|
||||
hostname,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export function usePagedQuery<T = any>({
|
|||
return {
|
||||
result: data as PageResult<T>,
|
||||
query,
|
||||
params,
|
||||
filterParams: params,
|
||||
setParams,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue