mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Updated fetch hook API.
This commit is contained in:
commit
69b317386a
21 changed files with 112 additions and 76 deletions
|
|
@ -5,7 +5,10 @@ import useFetch from 'hooks/useFetch';
|
|||
import styles from './ActiveUsers.module.css';
|
||||
|
||||
export default function ActiveUsers({ websiteId, token, className }) {
|
||||
const { data } = useFetch(`/api/website/${websiteId}/active`, { token }, { interval: 60000 });
|
||||
const { data } = useFetch(`/api/website/${websiteId}/active`, {
|
||||
params: { token },
|
||||
interval: 60000,
|
||||
});
|
||||
const count = useMemo(() => {
|
||||
return data?.[0]?.x || 0;
|
||||
}, [data]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue