From d615f9c120d9eec069e60d66ab1b057e6f3e1be2 Mon Sep 17 00:00:00 2001 From: Daniel Cojocea Date: Fri, 19 Jul 2024 18:30:44 -0400 Subject: [PATCH] Added missing onChange functions --- Client/src/Pages/Monitors/Configure/index.jsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Client/src/Pages/Monitors/Configure/index.jsx b/Client/src/Pages/Monitors/Configure/index.jsx index f74eeae58..d4395aae1 100644 --- a/Client/src/Pages/Monitors/Configure/index.jsx +++ b/Client/src/Pages/Monitors/Configure/index.jsx @@ -70,8 +70,8 @@ const Configure = () => { const idMap = { "monitor-url": "url", "monitor-name": "name", - "monitor-type": "type", - "monitor-interval": "interval", + "monitor-checks-http": "type", + "monitor-checks-ping": "type", }; const [config, setConfig] = useState(); @@ -96,9 +96,9 @@ const Configure = () => { fetchMonitor(); }, [monitorId, authToken]); - const handleChange = (event) => { + const handleChange = (event, name) => { const { value, id } = event.target; - const name = idMap[id]; + if (!name) name = idMap[id]; setMonitor((prev) => ({ ...prev, [name]: value, @@ -258,6 +258,7 @@ const Configure = () => { size="small" value="http" checked={monitor?.type === "http"} + onChange={handleChange} /> { size="small" value="ping" checked={monitor?.type === "ping"} + onChange={handleChange} /> {errors["type"] ? ( @@ -291,6 +293,7 @@ const Configure = () => {