mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
make website/team add consistent
This commit is contained in:
parent
194472b104
commit
86d482f18a
4 changed files with 25 additions and 18 deletions
|
|
@ -1,13 +1,15 @@
|
|||
import useApi from './useApi';
|
||||
import useFilterQuery from './useFilterQuery';
|
||||
import { useLogin } from 'components/hooks';
|
||||
import useModified from 'store/modified';
|
||||
|
||||
export function useTeams(userId?: string) {
|
||||
const { get } = useApi();
|
||||
const { user } = useLogin();
|
||||
const modified = useModified((state: any) => state?.teams);
|
||||
|
||||
return useFilterQuery({
|
||||
queryKey: ['teams', { userId: userId || user?.id }],
|
||||
queryKey: ['teams', { userId: userId || user?.id, modified }],
|
||||
queryFn: (params: any) => {
|
||||
return get(`/teams`, params);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue