implement JSON export

This commit is contained in:
Alex Holliday committed 2025-11-21 10:43:29 -08:00
1 parent fec32380ae
commit 58e7ef2527
7 files changed
+176

No files matched your search

+18
View File
@@ -538,6 +538,23 @@ const useExportMonitors = () => {
return [exportMonitors, isLoading];
};
const useFetchJson = () => {
const [isLoading, setIsLoading] = useState(false);
const fetchJson = async () => {
try {
setIsLoading(true);
const res = await networkService.fetchJson();
createToast({ body: "JSON fetched successfully" });
return res?.data?.data ?? [];
} catch (error) {
createToast({ body: "Failed to create monitor." });
} finally {
setIsLoading(false);
}
};
return [fetchJson, isLoading];
};
export {
useFetchMonitorsWithSummary,
useFetchMonitorsWithChecks,
@@ -557,4 +574,5 @@ export {
useCreateBulkMonitors,
useExportMonitors,
useFetchMonitorGames,
useFetchJson,
};