From f5ac47691d19d6da5a5aba03835a6915f9f7ca49 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 8 Aug 2024 14:29:25 -0700 Subject: [PATCH] fixed bad merge --- Client/src/Pages/Monitors/Details/index.jsx | 72 --------------------- 1 file changed, 72 deletions(-) diff --git a/Client/src/Pages/Monitors/Details/index.jsx b/Client/src/Pages/Monitors/Details/index.jsx index 4095fdf88..55dfd9335 100644 --- a/Client/src/Pages/Monitors/Details/index.jsx +++ b/Client/src/Pages/Monitors/Details/index.jsx @@ -133,82 +133,10 @@ const DetailsPage = () => { } }, [authToken, monitorId, navigate, filter]); - const fetchDataForChart = async () => { - try { - const limit = 0; - - const res = await axiosInstance.get( - `/monitors/${monitorId}?sortOrder=asc&limit=${limit}`, - { - headers: { - Authorization: `Bearer ${authToken}`, - }, - } - ); - const data = { - cols: [ - { id: 1, name: "Status" }, - { id: 2, name: "Date & Time" }, - { id: 3, name: "Message" }, - ], - rows: res.data.data.checks.map((check, idx) => { - const status = check.status === true ? "up" : "down"; - - return { - id: check._id, - data: [ - { - id: idx, - data: ( - - ), - }, - { - id: idx + 1, - data: new Date(check.createdAt).toLocaleString(), - }, - { id: idx + 2, data: check.statusCode }, - ], - }; - }), - }; - - setData(data); - } catch (error) { - console.log(error); - } - }; - - const fetchMonitor = async () => { - try { - const res = await axiosInstance.get( - `/monitors/${monitorId}?sortOrder=asc`, - { - headers: { - Authorization: `Bearer ${authToken}`, - }, - } - ); - setMonitor(res.data.data); - } catch (error) { - console.error("Error fetching monitor of id: " + monitorId); - navigate("/not-found"); - } - }; - useEffect(() => { fetchMonitor(); }, [fetchMonitor]); - useEffect(() => { - fetchDataForTable(); - }, [fetchDataForTable]); - - const theme = useTheme(); /**