mirror of
https://github.com/umami-software/umami.git
synced 2026-02-17 02:55:38 +01:00
Refactored useQuery functions.
This commit is contained in:
parent
be550cc440
commit
b578162cb6
33 changed files with 179 additions and 151 deletions
|
|
@ -20,9 +20,10 @@ export function Dashboard() {
|
|||
const { get, useQuery } = useApi();
|
||||
const { page, handlePageChange } = useApiFilter();
|
||||
const pageSize = 10;
|
||||
const { data: result, isLoading } = useQuery(['websites', page, pageSize], () =>
|
||||
get('/websites', { includeTeams: 1, page, pageSize }),
|
||||
);
|
||||
const { data: result, isLoading } = useQuery({
|
||||
queryKey: ['websites', page, pageSize],
|
||||
queryFn: () => get('/websites', { includeTeams: 1, page, pageSize }),
|
||||
});
|
||||
const { data, count } = result || {};
|
||||
const hasData = data && data?.length !== 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue