Fixed filter params.

This commit is contained in:
Mike Cao 2023-12-03 03:19:27 -08:00
parent 7c42f0da82
commit f3657685d1

View File

@ -19,10 +19,11 @@ export function useFilterQuery<T>({
query: '',
page: 1,
});
const { useQuery } = useApi();
const { data, ...query } = useQuery({
queryKey: [...queryKey, params],
queryFn: (data: any) => queryFn({ ...data, ...params }),
queryKey: [{ ...queryKey, ...params }],
queryFn: () => queryFn(params as any),
...options,
});