mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
New admin section.
This commit is contained in:
parent
b78ff3b477
commit
ce1f6c3618
44 changed files with 515 additions and 157 deletions
|
|
@ -1,15 +1,20 @@
|
|||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { usePagedQuery } from '@/components/hooks';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function useTeamsQuery(userId: string) {
|
||||
const { get, useQuery } = useApi();
|
||||
export function useTeamsQuery(params?: Record<string, any>, options?: ReactQueryOptions) {
|
||||
const { get } = useApi();
|
||||
const { modified } = useModified(`teams`);
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['teams', { userId, modified }],
|
||||
queryFn: () => {
|
||||
return get(`/users/${userId}/teams`, { userId });
|
||||
return usePagedQuery({
|
||||
queryKey: ['websites', { modified, ...params }],
|
||||
queryFn: pageParams => {
|
||||
return get(`/admin/teams`, {
|
||||
...params,
|
||||
...pageParams,
|
||||
});
|
||||
},
|
||||
enabled: !!userId,
|
||||
...options,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue