From 12d9f154bf09e21c62e320b350017bb24e93c1ac Mon Sep 17 00:00:00 2001 From: Skorpios Date: Wed, 12 Feb 2025 21:22:44 -0800 Subject: [PATCH] Got rid context bind in the route. --- Server/controllers/notificationController.js | 1 + Server/routes/notificationRoute.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/controllers/notificationController.js b/Server/controllers/notificationController.js index 6a19c3a1b..362b5b381 100644 --- a/Server/controllers/notificationController.js +++ b/Server/controllers/notificationController.js @@ -2,6 +2,7 @@ class NotificationController { constructor(notificationService) { this.notificationService = notificationService; + this.triggerNotification = this.triggerNotification.bind(this); } async triggerNotification(req, res, next) { diff --git a/Server/routes/notificationRoute.js b/Server/routes/notificationRoute.js index 4f8ae8539..1b38d91c8 100644 --- a/Server/routes/notificationRoute.js +++ b/Server/routes/notificationRoute.js @@ -36,7 +36,7 @@ class NotificationRoutes { '/trigger', verifyJWT, this.validateRequest(triggerNotificationBodyValidation), - this.notificationController.triggerNotification.bind(this.notificationController) + this.notificationController.triggerNotification ); }