Fetch data from endpoint instead of redux store

This commit is contained in:
Alex Holliday committed 2024-07-10 10:33:32 -07:00
1 parent 407edb6344
commit 5c1bb7ca6a
2 files changed
+18 -7

No files matched your search

+3 -1
View File
@@ -272,7 +272,9 @@ const getAllMonitors = async (req, res) => {
const getMonitorById = async (req, res) => {
try {
const monitor = await Monitor.findById(req.params.monitorId);
const checks = await Check.find({ monitorId: monitor._id });
const checks = await Check.find({ monitorId: monitor._id }).sort({
createdAt: -1,
});
const monitorWithChecks = { ...monitor.toObject(), checks };
return monitorWithChecks;
} catch (error) {