The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/views/hooks/useStatistics.ts

16 lines
453 B

import { useEndpoint } from '@rocket.chat/ui-contexts';
import { useQuery } from '@tanstack/react-query';
type UseStatisticsOptions = {
refresh?: 'false' | 'true';
};
export const useStatistics = ({ refresh }: UseStatisticsOptions = { refresh: 'false' }) => {
const getStatistics = useEndpoint('GET', '/v1/statistics');
return useQuery({
queryKey: ['analytics'],
queryFn: () => getStatistics({ refresh }),
staleTime: 10 * 60 * 1000,
});
};