mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
20 lines
531 B
TypeScript
20 lines
531 B
TypeScript
import { useApi } from '../useApi';
|
|
import { usePagedQuery } from '../usePagedQuery';
|
|
import { useModified } from '../useModified';
|
|
|
|
export function useGoalsQuery(
|
|
{ websiteId }: { websiteId: string },
|
|
params?: { [key: string]: string | number },
|
|
) {
|
|
const { get } = useApi();
|
|
const { modified } = useModified(`goals`);
|
|
|
|
return usePagedQuery({
|
|
queryKey: ['goals', { websiteId, modified, ...params }],
|
|
queryFn: () => {
|
|
return get(`/websites/${websiteId}/goals`, {
|
|
...params,
|
|
});
|
|
},
|
|
});
|
|
}
|