Refactor filter handling for queries.
This commit is contained in:
1 parent
5b300f1ff5
commit
ee6c68d27c
107 files changed
+731
-835
No files matched your search
@@ -4,7 +4,7 @@ import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function useResultQuery<T = any>(
|
||||
type: string,
|
||||
params?: { [key: string]: any },
|
||||
params?: Record<string, any>,
|
||||
options?: ReactQueryOptions<T>,
|
||||
) {
|
||||
const { websiteId } = params;
|
||||
@@ -21,7 +21,7 @@ export function useResultQuery<T = any>(
|
||||
...params,
|
||||
},
|
||||
],
|
||||
queryFn: () => post(`/reports/${type}`, { type, ...filters, ...params }),
|
||||
queryFn: () => post(`/reports/${type}`, { type, filters, ...params }),
|
||||
enabled: !!type,
|
||||
...options,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user