mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-20 00:29:45 -06:00
Get rid of test route function.
This commit is contained in:
@@ -25,28 +25,4 @@ router.post(
|
||||
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