vps-monitor/frontend/src/features/containers/hooks/use-container-history.ts
hhftechnologies aaf2d8b7fc Bug Fixes
###  Bug Fixes
2026-04-21 19:08:55 +05:30

13 lines
419 B
TypeScript

import { useQuery } from "@tanstack/react-query";
import { getContainerHistory } from "../api/get-container-history";
export function useContainerHistory(id: string, host: string, enabled = true) {
return useQuery({
queryKey: ["container-history", host, id],
queryFn: () => getContainerHistory(id, host),
enabled: enabled && Boolean(id) && Boolean(host),
staleTime: 60_000,
refetchInterval: 60_000,
});
}