mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 05:07:15 +01:00
17 lines
558 B
TypeScript
17 lines
558 B
TypeScript
import { useApi } from '../useApi';
|
|
import { usePagedQuery } from '../usePagedQuery';
|
|
import { useModified } from '../useModified';
|
|
import { ReactQueryOptions } from '@/lib/types';
|
|
|
|
export function useLinksQuery({ teamId }: { teamId?: string }, options?: ReactQueryOptions) {
|
|
const { modified } = useModified('links');
|
|
const { get } = useApi();
|
|
|
|
return usePagedQuery({
|
|
queryKey: ['links', { teamId, modified }],
|
|
queryFn: pageParams => {
|
|
return get(teamId ? `/teams/${teamId}/links` : '/links', pageParams);
|
|
},
|
|
...options,
|
|
});
|
|
}
|