From 284253638b6a6bf50eca8a63ef52cc7a1096d7f9 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 8 Aug 2024 11:32:48 -0700 Subject: [PATCH] Properly extract doc from mongoose model in Normalization --- Client/src/Components/Charts/MonitorDetailsAreaChart/index.jsx | 2 +- Server/utils/dataUtils.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Client/src/Components/Charts/MonitorDetailsAreaChart/index.jsx b/Client/src/Components/Charts/MonitorDetailsAreaChart/index.jsx index 863ba398f..567de0b68 100644 --- a/Client/src/Components/Charts/MonitorDetailsAreaChart/index.jsx +++ b/Client/src/Components/Charts/MonitorDetailsAreaChart/index.jsx @@ -27,7 +27,7 @@ const CustomToolTip = ({ active, payload, label }) => { return null; }; -const MonitorDetailsAreaChart = ({ checks, filter }) => { +const MonitorDetailsAreaChart = ({ checks }) => { // SQUASH ERROR, NOT PERMANENT SOLUTION const error = console.error; console.error = (...args) => { diff --git a/Server/utils/dataUtils.js b/Server/utils/dataUtils.js index 88112013d..3495cc3d6 100644 --- a/Server/utils/dataUtils.js +++ b/Server/utils/dataUtils.js @@ -19,6 +19,7 @@ const NormalizeData = (checks, rangeMin, rangeMax) => { const normalizedChecks = checks.map((check) => { const originalResponseTime = check.responseTime; + console.log(originalResponseTime); // Normalize the response time between 1 and 100 let normalizedResponseTime = rangeMin + @@ -31,7 +32,7 @@ const NormalizeData = (checks, rangeMin, rangeMax) => { Math.min(rangeMax, normalizedResponseTime) ); return { - ...check, + ...check._doc, responseTime: normalizedResponseTime, originalResponseTime: originalResponseTime, };