From 193e7d7371a66e4e753ca5c26e96e946f4ad10da Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 4 Sep 2024 23:14:15 -0700 Subject: [PATCH] Fixed incident data access --- Client/src/Pages/Incidents/index.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Client/src/Pages/Incidents/index.jsx b/Client/src/Pages/Incidents/index.jsx index d5d8d001e..0bfc46325 100644 --- a/Client/src/Pages/Incidents/index.jsx +++ b/Client/src/Pages/Incidents/index.jsx @@ -29,11 +29,14 @@ const Incidents = () => { null, null, null, + null, + null, null ); + console.log(res); // Reduce to a lookup object for 0(1) lookup - if (res.data && res.data.data.length > 0) { - const monitorLookup = res.data.data.reduce((acc, monitor) => { + if (res?.data?.data?.monitors?.length > 0) { + const monitorLookup = res.data.data.monitors.reduce((acc, monitor) => { acc[monitor._id] = monitor; return acc; }, {});