From 61e319ef444569829d60032b9643bafe49d6abd7 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 10 Feb 2025 13:47:13 -0800 Subject: [PATCH] allow editing in create component --- Client/src/Pages/DistributedUptime/Create/index.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Client/src/Pages/DistributedUptime/Create/index.jsx b/Client/src/Pages/DistributedUptime/Create/index.jsx index 2df0a4482..a0efca428 100644 --- a/Client/src/Pages/DistributedUptime/Create/index.jsx +++ b/Client/src/Pages/DistributedUptime/Create/index.jsx @@ -18,6 +18,7 @@ import { useNavigate } from "react-router-dom"; import { useSelector, useDispatch } from "react-redux"; import { monitorValidation } from "../../../Validation/validation"; import { createUptimeMonitor } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice"; +import { useLocation } from "react-router-dom"; // Constants const BREADCRUMBS = [ @@ -34,6 +35,9 @@ const SELECT_VALUES = [ ]; const CreateDistributedUptime = () => { + const location = useLocation(); + const isCreate = location.pathname.startsWith("/distributed-uptime/create"); + // Redux state const { user, authToken } = useSelector((state) => state.auth); const isLoading = useSelector((state) => state.uptimeMonitors.isLoading); @@ -103,7 +107,6 @@ const CreateDistributedUptime = () => { { [name]: value }, { abortEarly: false } ); - console.log(name); setErrors((prev) => ({ ...prev, ...(error ? { [name]: error.details[0].message } : { [name]: undefined }),