mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Fixed reports queries.
This commit is contained in:
parent
40970f6c33
commit
87bb9b1e73
5 changed files with 21 additions and 13 deletions
|
|
@ -6,11 +6,9 @@ export function useReports({ websiteId, teamId }: { websiteId?: string; teamId?:
|
|||
const modified = useCache((state: any) => state?.reports);
|
||||
const { get, del, useMutation } = useApi();
|
||||
const queryResult = useFilterQuery({
|
||||
queryKey: ['reports', { websiteId, modified }],
|
||||
queryKey: ['reports', { websiteId, teamId, modified }],
|
||||
queryFn: (params: any) => {
|
||||
const url = websiteId ? `/websites/${websiteId}/reports` : `/reports`;
|
||||
|
||||
return get(teamId ? `/teams/${teamId}${url}` : url, params);
|
||||
return get('/reports', { websiteId, teamId, ...params });
|
||||
},
|
||||
});
|
||||
const { mutate } = useMutation({ mutationFn: (reportId: string) => del(`/reports/${reportId}`) });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue