reorder routes for correctness

This commit is contained in:
Alex Holliday committed 2025-07-21 09:55:49 -07:00
1 parent dae0d6cc42
commit 0c04db3299
17 files changed
+123 -127

No files matched your search

+7 -13
View File
@@ -6,35 +6,29 @@ import MaintenanceWindow from "../db/models/MaintenanceWindow.js";
class MaintenanceWindowRoutes {
constructor(maintenanceWindowController) {
this.router = Router();
this.maintenanceWindowController = maintenanceWindowController;
this.mwController = maintenanceWindowController;
this.initRoutes();
}
initRoutes() {
this.router.post("/", this.maintenanceWindowController.createMaintenanceWindows);
this.router.post("/", this.mwController.createMaintenanceWindows);
this.router.get("/team/", this.mwController.getMaintenanceWindowsByTeamId);
this.router.get(
"/monitor/:monitorId",
verifyOwnership(Monitor, "monitorId"),
this.maintenanceWindowController.getMaintenanceWindowsByMonitorId
this.mwController.getMaintenanceWindowsByMonitorId
);
this.router.get(
"/team/",
this.maintenanceWindowController.getMaintenanceWindowsByTeamId
);
this.router.get("/:id", this.maintenanceWindowController.getMaintenanceWindowById);
this.router.get("/:id", this.mwController.getMaintenanceWindowById);
this.router.put(
"/:id",
verifyTeamAccess(MaintenanceWindow, "id"),
this.maintenanceWindowController.editMaintenanceWindow
this.mwController.editMaintenanceWindow
);
this.router.delete(
"/:id",
verifyTeamAccess(MaintenanceWindow, "id"),
this.maintenanceWindowController.deleteMaintenanceWindow
this.mwController.deleteMaintenanceWindow
);
}