This commit is contained in:
Alex Holliday committed 2024-09-04 11:54:20 -07:00
1 parent ffc132e19a
commit be582edeeb
2 files changed
+5 -4

No files matched your search

@@ -89,6 +89,7 @@ const DetailsPage = ({ isAdmin }) => {
50,
true
);
console.log(res.data.data);
setMonitor(res?.data?.data ?? {});
} catch (error) {
logger.error(error);
+4 -4
View File
@@ -200,11 +200,11 @@ const getMonitorStatsById = async (req) => {
}, {});
} else {
groupedChecks = checksForDateRange.reduce((acc, check) => {
const day = new Date(check.createdAt).toISOString().split("T")[0]; // Extract the date part
if (!acc[day]) {
acc[day] = { day, checks: [] };
const time = new Date(check.createdAt).toISOString().split("T")[0]; // Extract the date part
if (!acc[time]) {
acc[time] = { time, checks: [] };
}
acc[day].checks.push(check);
acc[time].checks.push(check);
return acc;
}, {});
}