Files
Checkmate/server/src/routes/maintenanceWindowRoute.ts
T

28 lines
831 B
TypeScript
Raw Normal View History

2025-04-20 11:29:53 -07:00
import { Router } from "express";
2025-10-20 14:22:20 +08:00
2025-04-20 11:29:53 -07:00
class MaintenanceWindowRoutes {
2026-01-21 10:36:03 -08:00
private router: Router;
private mwController: any;
constructor(maintenanceWindowController: any) {
2025-04-20 11:29:53 -07:00
this.router = Router();
2025-07-21 09:55:49 -07:00
this.mwController = maintenanceWindowController;
2025-04-20 11:29:53 -07:00
this.initRoutes();
}
initRoutes() {
2025-07-21 09:55:49 -07:00
this.router.post("/", this.mwController.createMaintenanceWindows);
this.router.get("/team/", this.mwController.getMaintenanceWindowsByTeamId);
2025-04-20 11:29:53 -07:00
2025-07-21 12:27:53 -07:00
this.router.get("/monitor/:monitorId", this.mwController.getMaintenanceWindowsByMonitorId);
2025-04-20 11:29:53 -07:00
2025-07-21 09:55:49 -07:00
this.router.get("/:id", this.mwController.getMaintenanceWindowById);
2026-02-04 19:30:41 +00:00
this.router.patch("/:id", this.mwController.editMaintenanceWindow);
2025-07-21 12:27:53 -07:00
this.router.delete("/:id", this.mwController.deleteMaintenanceWindow);
2025-04-20 11:29:53 -07:00
}
getRouter() {
return this.router;
}
}
export default MaintenanceWindowRoutes;