From 6efc05879a904f1ce733996f779a29965fbed0e2 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 27 Jan 2026 21:54:20 +0000 Subject: [PATCH 1/2] cast to string --- server/src/controllers/authController.ts | 4 ++-- server/src/controllers/checkController.ts | 2 +- server/src/controllers/incidentController.ts | 2 +- server/src/controllers/maintenanceWindowController.ts | 8 ++++---- server/src/controllers/notificationController.ts | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/server/src/controllers/authController.ts b/server/src/controllers/authController.ts index 23ea6e42e..165bec056 100755 --- a/server/src/controllers/authController.ts +++ b/server/src/controllers/authController.ts @@ -197,7 +197,7 @@ class AuthController { throw new AppError({ message: "Unauthorized", status: 403 }); } - const userId = req.params.userId; + const userId = req.params.userId as string; const user = { ...req.body }; await editUserByIdParamValidation.validateAsync(req.params); @@ -222,7 +222,7 @@ class AuthController { throw new AppError({ message: "Unauthorized", status: 403 }); } - const userId = req.params.userId; + const userId = req.params.userId as string; await editUserByIdParamValidation.validateAsync(req.params); await editUserPasswordByIdBodyValidation.validateAsync(req.body); const updatedPassword = req.body.password; diff --git a/server/src/controllers/checkController.ts b/server/src/controllers/checkController.ts index b13663d97..0c085f6d3 100755 --- a/server/src/controllers/checkController.ts +++ b/server/src/controllers/checkController.ts @@ -83,7 +83,7 @@ class CheckController { await deleteChecksParamValidation.validateAsync(req.params); const deletedCount = await this.checkService.deleteChecks({ - monitorId: req.params.monitorId, + monitorId: req.params.monitorId as string, teamId: req?.user?.teamId, }); diff --git a/server/src/controllers/incidentController.ts b/server/src/controllers/incidentController.ts index 72e6498f9..5f2b6d154 100644 --- a/server/src/controllers/incidentController.ts +++ b/server/src/controllers/incidentController.ts @@ -67,7 +67,7 @@ class IncidentController { getIncidentById = async (req: Request, res: Response, next: NextFunction) => { try { const teamId = requireTeamId(req.user?.teamId); - const incidentId = req.params.incidentId; + const incidentId = req.params.incidentId as string; if (!incidentId) { throw new AppError({ message: "Incident ID is required", service: SERVICE_NAME, status: 400 }); } diff --git a/server/src/controllers/maintenanceWindowController.ts b/server/src/controllers/maintenanceWindowController.ts index 0cc9610ea..1e8aba483 100644 --- a/server/src/controllers/maintenanceWindowController.ts +++ b/server/src/controllers/maintenanceWindowController.ts @@ -44,7 +44,7 @@ class MaintenanceWindowController { const teamId = requireTeamId(req.user?.teamId); - const maintenanceWindow = await this.maintenanceWindowService.getMaintenanceWindowById({ id: req.params.id, teamId }); + const maintenanceWindow = await this.maintenanceWindowService.getMaintenanceWindowById({ id: req.params.id as string, teamId }); return res.status(200).json({ success: true, @@ -80,7 +80,7 @@ class MaintenanceWindowController { const teamId = requireTeamId(req?.user?.teamId); - const maintenanceWindows = await this.maintenanceWindowService.getMaintenanceWindowsByMonitorId({ monitorId: req.params.monitorId, teamId }); + const maintenanceWindows = await this.maintenanceWindowService.getMaintenanceWindowsByMonitorId({ monitorId: req.params.monitorId as string, teamId }); return res.status(200).json({ success: true, @@ -97,7 +97,7 @@ class MaintenanceWindowController { const teamId = requireTeamId(req?.user?.teamId); - await this.maintenanceWindowService.deleteMaintenanceWindow({ id: req.params.id, teamId }); + await this.maintenanceWindowService.deleteMaintenanceWindow({ id: req.params.id as string, teamId }); return res.status(200).json({ success: true, @@ -115,7 +115,7 @@ class MaintenanceWindowController { const teamId = requireTeamId(req.user?.teamId); - const editedMaintenanceWindow = await this.maintenanceWindowService.editMaintenanceWindow({ id: req.params.id, body: req.body, teamId }); + const editedMaintenanceWindow = await this.maintenanceWindowService.editMaintenanceWindow({ id: req.params.id as string, body: req.body, teamId }); return res.status(200).json({ success: true, msg: "Maintenance window edited successfully", diff --git a/server/src/controllers/notificationController.ts b/server/src/controllers/notificationController.ts index 1aa10a82c..f32f80ddc 100644 --- a/server/src/controllers/notificationController.ts +++ b/server/src/controllers/notificationController.ts @@ -97,7 +97,7 @@ class NotificationController { throw new AppError({ message: "Team ID is required", status: 400 }); } - const notificationId = req.params.id; + const notificationId = req.params.id as string; if (!notificationId) { throw new AppError({ message: "Notification ID is required", status: 400 }); } @@ -115,7 +115,7 @@ class NotificationController { getNotificationById = async (req: Request, res: Response, next: NextFunction) => { try { const teamId = requireTeamId(req.user?.teamId); - const notificationId = req.params.id; + const notificationId = req.params.id as string; if (!notificationId) { throw new AppError({ message: "Notification ID is required", status: 400 }); } @@ -139,7 +139,7 @@ class NotificationController { }); const teamId = requireTeamId(req.user?.teamId); - const notificationId = req.params.id; + const notificationId = req.params.id as string; if (!notificationId) { throw new AppError({ message: "Notification ID is required", status: 400 }); } From 589825c1c500dd33bc702ee4f3a37c8471baa30e Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 27 Jan 2026 21:57:55 +0000 Subject: [PATCH 2/2] format --- server/src/controllers/maintenanceWindowController.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/server/src/controllers/maintenanceWindowController.ts b/server/src/controllers/maintenanceWindowController.ts index 1e8aba483..187e479cc 100644 --- a/server/src/controllers/maintenanceWindowController.ts +++ b/server/src/controllers/maintenanceWindowController.ts @@ -80,7 +80,10 @@ class MaintenanceWindowController { const teamId = requireTeamId(req?.user?.teamId); - const maintenanceWindows = await this.maintenanceWindowService.getMaintenanceWindowsByMonitorId({ monitorId: req.params.monitorId as string, teamId }); + const maintenanceWindows = await this.maintenanceWindowService.getMaintenanceWindowsByMonitorId({ + monitorId: req.params.monitorId as string, + teamId, + }); return res.status(200).json({ success: true, @@ -115,7 +118,11 @@ class MaintenanceWindowController { const teamId = requireTeamId(req.user?.teamId); - const editedMaintenanceWindow = await this.maintenanceWindowService.editMaintenanceWindow({ id: req.params.id as string, body: req.body, teamId }); + const editedMaintenanceWindow = await this.maintenanceWindowService.editMaintenanceWindow({ + id: req.params.id as string, + body: req.body, + teamId, + }); return res.status(200).json({ success: true, msg: "Maintenance window edited successfully",