Merge pull request #2620 from bluewave-labs/feat/diagnostics

Feat/diagnostics
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-07-15 15:21:15 -07:00
commit c54feb9306
3 files changed
+31 -16

No files matched your search

+16 -12
View File
@@ -89,22 +89,26 @@ const useFetchDiagnostics = () => {
const [error, setError] = useState(undefined);
const [diagnostics, setDiagnostics] = useState(undefined);
const fetchDiagnostics = async () => {
try {
setIsLoading(true);
const response = await networkService.getDiagnostics();
setDiagnostics(response.data.data);
} catch (error) {
createToast({
body: error.message,
});
setError(error);
} finally {
setIsLoading(false);
}
};
useEffect(() => {
const fetchDiagnostics = async () => {
try {
setIsLoading(true);
const response = await networkService.getDiagnostics();
setDiagnostics(response.data.data);
} catch (error) {
setError(error);
} finally {
setIsLoading(false);
}
};
fetchDiagnostics();
}, []);
return [diagnostics, isLoading, error];
return [diagnostics, fetchDiagnostics, isLoading, error];
};
export { useFetchLogs, useFetchQueueData, useFlushQueue, useFetchDiagnostics };