up
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import * as api from '../service/DashboardService';
|
||||
|
||||
const DASHBOARD_COUNTS_REFETCH_MS = 2 * 60 * 1000;
|
||||
|
||||
export const useGetDashboardCounts = () => {
|
||||
return useQuery({
|
||||
queryKey: ['dashboard-counts'],
|
||||
queryFn: () => api.getDashboardCounts(),
|
||||
refetchInterval: DASHBOARD_COUNTS_REFETCH_MS,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user