Removed 404 error thrown when user has no monitors to display

This commit is contained in:
Alex Holliday
2024-07-12 11:30:36 -07:00
parent 9867089c73
commit 38102d1e7b
-6
View File
@@ -87,12 +87,6 @@ const getMonitorsByUserId = async (req, res, next) => {
const userId = req.params.userId;
const monitors = await req.db.getMonitorsByUserId(req, res);
if (monitors && monitors.length === 0) {
const err = new Error(errorMessages.MONITOR_GET_BY_USER_ID);
err.status = 404;
throw err;
}
return res.json({
success: true,
msg: successMessages.MONITOR_GET_BY_USER_ID(userId),