Properly extract doc from mongoose model in Normalization

This commit is contained in:
Alex Holliday committed 2024-08-08 11:32:48 -07:00
1 parent 51058b6d2b
commit 284253638b
2 files changed
+3 -2

No files matched your search

@@ -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) => {
+2 -1
View File
@@ -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,
};