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 ); }