mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Teams context settings.
This commit is contained in:
parent
4429198397
commit
8f853ddb97
77 changed files with 317 additions and 272 deletions
|
|
@ -2,14 +2,18 @@ import useApi from './useApi';
|
|||
import useFilterQuery from './useFilterQuery';
|
||||
import useCache from 'store/cache';
|
||||
|
||||
export function useWebsites({ userId, teamId }: { userId?: string; teamId?: string }) {
|
||||
export function useWebsites(
|
||||
{ userId, teamId }: { userId?: string; teamId?: string },
|
||||
params?: { [key: string]: string | number },
|
||||
) {
|
||||
const { get } = useApi();
|
||||
const modified = useCache((state: any) => state?.websites);
|
||||
|
||||
return useFilterQuery({
|
||||
queryKey: ['websites', { userId, teamId, modified }],
|
||||
queryFn: (params: any) => {
|
||||
queryKey: ['websites', { userId, teamId, modified, ...params }],
|
||||
queryFn: (data: any) => {
|
||||
return get(teamId ? `/teams/${teamId}/websites` : `/users/${userId}/websites`, {
|
||||
...data,
|
||||
...params,
|
||||
});
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue