Files
BayIQ-UI/src/features/dashboard/hooks/useGetStore.ts
Toba Ojo f7964d4fc0 - added download button
- added reads for number plate sightings
2025-12-03 10:46:36 +00:00

20 lines
510 B
TypeScript

import { useQuery } from "@tanstack/react-query";
import { CAMBASE } from "../../../utils/config";
const getStoreData = async () => {
const response = await fetch(`${CAMBASE}/Store0/diagnostics-json`);
if (!response.ok) {
throw new Error("Network response was not ok");
}
return response.json();
};
export const useGetStore = () => {
const storeQuery = useQuery({
queryKey: ["storeData"],
queryFn: getStoreData,
// refetchInterval: 10 * 60 * 1000,
});
return { storeQuery };
};