Get rid of test route function.
This commit is contained in:
1 parent
66d101877a
commit
67711ffe2c
1 file changed
-24
@@ -25,28 +25,4 @@ router.post(
|
|||||||
checkController.deleteChecks
|
checkController.deleteChecks
|
||||||
);
|
);
|
||||||
|
|
||||||
// Temporary test route
|
|
||||||
router.post("/test-notification/:monitorId", async (req, res) => {
|
|
||||||
try {
|
|
||||||
const monitorId = req.params.monitorId;
|
|
||||||
const monitor = await Monitor.findById(monitorId);
|
|
||||||
if (!monitor) {
|
|
||||||
return res.status(404).json({ message: "Monitor not found" });
|
|
||||||
}
|
|
||||||
|
|
||||||
const newCheck = new Check({
|
|
||||||
monitorId,
|
|
||||||
status: false,
|
|
||||||
responseTime: 100,
|
|
||||||
statusCode: 500,
|
|
||||||
message: "Server error"
|
|
||||||
});
|
|
||||||
|
|
||||||
await newCheck.save();
|
|
||||||
res.status(201).json({ message: "Check created and email notification sent" });
|
|
||||||
} catch (error) {
|
|
||||||
res.status(500).json({ message: error.message });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = router;
|
|
||||||
Reference in new issue
Block a user