mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
Pixel/links development. New validations folder. More refactoring.
This commit is contained in:
parent
88639dfe83
commit
247e14646b
136 changed files with 1395 additions and 516 deletions
|
|
@ -3,17 +3,15 @@ import { usePagedQuery } from '../usePagedQuery';
|
|||
import { useModified } from '../useModified';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function usePixelsQuery(
|
||||
{ websiteId, type }: { websiteId: string; type?: string },
|
||||
options?: ReactQueryOptions<any>,
|
||||
) {
|
||||
const { modified } = useModified(`pixels:${type}`);
|
||||
export function usePixelsQuery({ teamId }: { teamId?: string }, options?: ReactQueryOptions) {
|
||||
const { modified } = useModified('pixels');
|
||||
const { get } = useApi();
|
||||
|
||||
return usePagedQuery({
|
||||
queryKey: ['pixels', { websiteId, type, modified }],
|
||||
queryFn: async () => get('/pixels', { websiteId, type }),
|
||||
enabled: !!websiteId && !!type,
|
||||
queryKey: ['pixels', { teamId, modified }],
|
||||
queryFn: pageParams => {
|
||||
return get(teamId ? `/teams/${teamId}/pixels` : '/pixels', pageParams);
|
||||
},
|
||||
...options,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue