mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Refactored useQuery functions.
This commit is contained in:
parent
be550cc440
commit
b578162cb6
33 changed files with 179 additions and 151 deletions
|
|
@ -7,14 +7,12 @@ import styles from './ActiveUsers.module.css';
|
|||
export function ActiveUsers({ websiteId, value, refetchInterval = 60000 }) {
|
||||
const { formatMessage, messages } = useMessages();
|
||||
const { get, useQuery } = useApi();
|
||||
const { data } = useQuery(
|
||||
['websites:active', websiteId],
|
||||
() => get(`/websites/${websiteId}/active`),
|
||||
{
|
||||
refetchInterval,
|
||||
enabled: !!websiteId,
|
||||
},
|
||||
);
|
||||
const { data } = useQuery({
|
||||
queryKey: ['websites:active', websiteId],
|
||||
queryFn: () => get(`/websites/${websiteId}/active`),
|
||||
refetchInterval,
|
||||
enabled: !!websiteId,
|
||||
});
|
||||
|
||||
const count = useMemo(() => {
|
||||
if (websiteId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue