- added download button
- added reads for number plate sightings
This commit is contained in:
19
src/features/dashboard/hooks/useGetStore.ts
Normal file
19
src/features/dashboard/hooks/useGetStore.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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 };
|
||||
};
|
||||
Reference in New Issue
Block a user