Files
BayIQ-UI/src/features/dashboard/hooks/useGetSystemHealth.ts

16 lines
412 B
TypeScript
Raw Normal View History

2025-11-24 14:54:05 +00:00
import { useQuery } from "@tanstack/react-query";
const fetchData = async () => {
const response = await fetch(`http://100.115.148.59/api/system-health`);
2025-11-24 14:54:05 +00:00
if (!response.ok) throw new Error("Cannot get System overview");
return response.json();
};
export const useGetSystemHealth = () => {
const query = useQuery({
queryKey: ["fetchSystemData"],
queryFn: fetchData,
});
return { query };
};