remove check ack routes and controller functions

This commit is contained in:
Alex Holliday
2026-01-20 19:25:00 +00:00
parent 36b02e5e66
commit 476ff39a17
2 changed files with 0 additions and 52 deletions
-47
View File
@@ -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);
-5
View File
@@ -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() {