From 20868135c1df33b8b735ae2296e4a11952b6a7ae Mon Sep 17 00:00:00 2001 From: Ananya Verma Date: Fri, 23 Aug 2024 00:28:21 +0530 Subject: [PATCH] remove pages/monitors/index.js --- Client/src/App.jsx | 6 +----- Client/src/Pages/Monitors/CreateMonitor/index.jsx | 8 +++++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 6cda26892..405371db2 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -56,11 +56,7 @@ function App() { element={} /> } - /> - } /> { const data = monitors.find((monitor) => monitor._id === monitorId); if (!data) { console.error("Error fetching monitor of id: " + monitorId); - navigate("/not-found"); + navigate("/not-found", {replace: true}); } - const {url, name, ...rest} = data; - rest.interval = rest.interval/60000; + const {name, ...rest} = data; //data.name is read-only + if(rest.type == 'http') rest.url = rest.url.substring(8, rest.url.length) + rest.name = `${name} (Clone)`; + rest.interval /= 60000; setMonitor({ ...rest, });