From 8814596d6e566e8bd10b28efe3b0734c7e0036b3 Mon Sep 17 00:00:00 2001 From: gorkem-bwl Date: Thu, 15 Jan 2026 21:27:37 -0500 Subject: [PATCH] Fix pagespeed monitor deletion failing with undefined ID The delete handler was using monitor._id from state, which was undefined because the fetched monitor object didn't have _id populated. Changed to use monitorId directly from URL params, which is already available and used by other handlers in the same component (e.g., handlePause). Fixes "Failed to delete monitor" error when removing pagespeed monitors. --- client/src/Pages/PageSpeed/Create/index.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/Pages/PageSpeed/Create/index.jsx b/client/src/Pages/PageSpeed/Create/index.jsx index 2cce26159..69218d8cb 100644 --- a/client/src/Pages/PageSpeed/Create/index.jsx +++ b/client/src/Pages/PageSpeed/Create/index.jsx @@ -178,8 +178,7 @@ const PageSpeedSetup = () => { const handleRemove = async (event) => { event.preventDefault(); - const TEMP_MONITOR = { id: monitor._id }; - await deleteMonitor({ monitor: TEMP_MONITOR, redirect: "/pagespeed" }); + await deleteMonitor({ monitor: { id: monitorId }, redirect: "/pagespeed" }); }; const isBusy = isLoading || isCreating || isDeleting || isUpdating || isPausing;