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

16 lines
413 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://192.168.202.121/api/system-health`);
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 };
};