correcetd route and method for delete route
This commit is contained in:
1 parent
beb9356a5f
commit
bc3a47e264
1 file changed
+9
-21
@@ -9,13 +9,9 @@ const Monitor = require("../models/Monitor");
|
|||||||
* @param {string} monitorId - The ID of the monitor
|
* @param {string} monitorId - The ID of the monitor
|
||||||
* @middleware verifyOwnership - Ensures the user owns the monitor
|
* @middleware verifyOwnership - Ensures the user owns the monitor
|
||||||
*/
|
*/
|
||||||
router.post(
|
router.post("/:monitorId", verifyOwnership(Monitor, "monitorId"), () => {
|
||||||
"/:monitorId",
|
console.log("Create check");
|
||||||
verifyOwnership(Monitor, "monitorId"),
|
});
|
||||||
() => {
|
|
||||||
console.log("Create check");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @route GET /:monitorId
|
* @route GET /:monitorId
|
||||||
@@ -24,13 +20,9 @@ router.post(
|
|||||||
* @param {string} monitorId - The ID of the monitor
|
* @param {string} monitorId - The ID of the monitor
|
||||||
* @middleware verifyOwnership - Ensures the user owns the monitor
|
* @middleware verifyOwnership - Ensures the user owns the monitor
|
||||||
*/
|
*/
|
||||||
router.get(
|
router.get("/:monitorId", verifyOwnership(Monitor, "monitorId"), () => {
|
||||||
"/:monitorId",
|
console.log("Get checks");
|
||||||
verifyOwnership(Monitor, "monitorId"),
|
});
|
||||||
() => {
|
|
||||||
console.log("Get checks");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @route POST /delete/:monitorId
|
* @route POST /delete/:monitorId
|
||||||
@@ -39,12 +31,8 @@ router.get(
|
|||||||
* @param {string} monitorId - The ID of the monitor
|
* @param {string} monitorId - The ID of the monitor
|
||||||
* @middleware verifyOwnership - Ensures the user owns the monitor
|
* @middleware verifyOwnership - Ensures the user owns the monitor
|
||||||
*/
|
*/
|
||||||
router.post(
|
router.delete("/:monitorId", verifyOwnership(Monitor, "monitorId"), () => {
|
||||||
"/delete/:monitorId",
|
console.log("Delete checks");
|
||||||
verifyOwnership(Monitor, "monitorId"),
|
});
|
||||||
() => {
|
|
||||||
console.log("Delete checks");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
Reference in new issue
Block a user