From 476ff39a17cd423bb7ebec59f6ffa80ac94661dd Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 20 Jan 2026 19:25:00 +0000 Subject: [PATCH] remove check ack routes and controller functions --- server/src/controllers/checkController.ts | 47 ----------------------- server/src/routes/v1/checkRoute.js | 5 --- 2 files changed, 52 deletions(-) diff --git a/server/src/controllers/checkController.ts b/server/src/controllers/checkController.ts index 8ae6fd785..8277df3e7 100755 --- a/server/src/controllers/checkController.ts +++ b/server/src/controllers/checkController.ts @@ -77,53 +77,6 @@ class CheckController { } }; - ackCheck = async (req: Request, res: Response, next: NextFunction) => { - try { - await ackCheckBodyValidation.validateAsync(req.body); - - const updatedCheck = await this.checkService.ackCheck({ - checkId: req?.params?.checkId, - teamId: req?.user?.teamId, - ack: req?.body?.ack, - }); - - return res.status(200).json({ - success: true, - msg: "Check acknowledged successfully", - data: updatedCheck, - }); - } catch (error) { - next(error); - } - }; - - ackAllChecks = async (req: Request, res: Response, next: NextFunction) => { - try { - await ackAllChecksParamValidation.validateAsync(req.params); - await ackAllChecksBodyValidation.validateAsync(req.body); - - const teamId = req?.user?.teamId; - if (!teamId) { - throw new Error("No team ID in request"); - } - - const updatedChecks = await this.checkService.ackAllChecks({ - monitorId: req?.params?.monitorId, - path: req?.params?.path, - teamId: req?.user?.teamId, - ack: req?.body?.ack, - }); - - return res.status(200).json({ - success: true, - msg: "All checks acknowledged successfully", - data: updatedChecks, - }); - } catch (error) { - next(error); - } - }; - deleteChecks = async (req: Request, res: Response, next: NextFunction) => { try { await deleteChecksParamValidation.validateAsync(req.params); diff --git a/server/src/routes/v1/checkRoute.js b/server/src/routes/v1/checkRoute.js index 78f6b8a42..6565425d4 100755 --- a/server/src/routes/v1/checkRoute.js +++ b/server/src/routes/v1/checkRoute.js @@ -14,13 +14,8 @@ class CheckRoutes { this.router.get("/team", this.checkController.getChecksByTeam); this.router.put("/team/ttl", isAllowed(["admin", "superadmin"]), this.checkController.updateChecksTTL); this.router.delete("/team", isAllowed(["admin", "superadmin"]), this.checkController.deleteChecksByTeamId); - - this.router.put("/check/:checkId", this.checkController.ackCheck); - this.router.get("/:monitorId", this.checkController.getChecksByMonitor); this.router.delete("/:monitorId", this.checkController.deleteChecks); - - this.router.put("/:path/:monitorId?", this.checkController.ackAllChecks); } getRouter() {