Add tests for getAllMonitors and getMonitorStatsById

This commit is contained in:
Alex Holliday committed 2024-10-11 14:23:35 +08:00
1 parent fbdbf5897e
commit 644363e3bb
2 files changed
+115 -2

No files matched your search

+2 -2
View File
@@ -33,7 +33,7 @@ const { handleError, handleValidationError } = require("./controllerUtils");
const getAllMonitors = async (req, res, next) => {
try {
const monitors = await req.db.getAllMonitors();
return res.json({
return res.status(200).json({
success: true,
msg: successMessages.MONITOR_GET_ALL,
data: monitors,
@@ -63,7 +63,7 @@ const getMonitorStatsById = async (req, res, next) => {
try {
const monitorStats = await req.db.getMonitorStatsById(req);
return res.json({
return res.status(200).json({
success: true,
msg: successMessages.MONITOR_STATS_BY_ID,
data: monitorStats,