Fetch data from endpoint instead of redux store
This commit is contained in:
1 parent
407edb6344
commit
5c1bb7ca6a
2 files changed
+18
-7
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user