mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 18:45:36 +01:00
Refactored useQuery functions.
This commit is contained in:
parent
be550cc440
commit
b578162cb6
33 changed files with 179 additions and 151 deletions
|
|
@ -21,17 +21,17 @@ function useWebsites(userId: string, { includeTeams, onlyTeams }) {
|
|||
const { get } = useApi();
|
||||
const modified = useCache((state: any) => state?.websites);
|
||||
|
||||
return useFilterQuery(
|
||||
['websites', { includeTeams, onlyTeams, modified }],
|
||||
(params: any) => {
|
||||
return useFilterQuery({
|
||||
queryKey: ['websites', { includeTeams, onlyTeams, modified }],
|
||||
queryFn: (params: any) => {
|
||||
return get(`/users/${userId}/websites`, {
|
||||
includeTeams,
|
||||
onlyTeams,
|
||||
...params,
|
||||
});
|
||||
},
|
||||
{ enabled: !!userId },
|
||||
);
|
||||
enabled: !!userId,
|
||||
});
|
||||
}
|
||||
|
||||
export function WebsitesDataTable({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue