fix aith for notification controller
This commit is contained in:
1 parent
78b371bfad
commit
1b085236c7
3 files changed
+77
-14
No files matched your search
@@ -1,8 +1,4 @@
|
||||
import { Router } from "express";
|
||||
import { verifyJWT } from "../middleware/verifyJWT.js";
|
||||
import { verifyOwnership } from "../middleware/verifyOwnership.js";
|
||||
import { verifyTeamAccess } from "../middleware/verifyTeamAccess.js";
|
||||
import Notification from "../db/models/Notification.js";
|
||||
class NotificationRoutes {
|
||||
constructor(notificationController) {
|
||||
this.router = Router();
|
||||
@@ -11,8 +7,6 @@ class NotificationRoutes {
|
||||
}
|
||||
|
||||
initializeRoutes() {
|
||||
this.router.use(verifyJWT);
|
||||
|
||||
this.router.post("/", this.notificationController.createNotification);
|
||||
|
||||
this.router.post("/test/all", this.notificationController.testAllNotifications);
|
||||
@@ -20,9 +14,9 @@ class NotificationRoutes {
|
||||
|
||||
this.router.get("/team", this.notificationController.getNotificationsByTeamId);
|
||||
|
||||
this.router.delete("/:id", verifyOwnership(Notification, "id"), this.notificationController.deleteNotification);
|
||||
this.router.get("/:id", this.notificationController.getNotificationById);
|
||||
this.router.put("/:id", verifyTeamAccess(Notification, "id"), this.notificationController.editNotification);
|
||||
this.router.delete("/:id", this.notificationController.deleteNotification);
|
||||
this.router.put("/:id", this.notificationController.editNotification);
|
||||
}
|
||||
|
||||
getRouter() {
|
||||
|
||||
Reference in new issue
Block a user