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