Files
BayIQ-UI/src/features/dashboard/hooks/useGetSystemHealth.ts
Toba Ojo 3c10ff82cb - updated base for endpoints
- added loading states
- need to add new form for ftp type
2025-11-27 09:43:09 +00:00

17 lines
450 B
TypeScript

import { useQuery } from "@tanstack/react-query";
import { CAMBASE } from "../../../utils/config";
const fetchData = async () => {
const response = await fetch(`${CAMBASE}/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 };
};