Files
Checkmate/server/src/routes/v1/incidentRoute.js
T

26 lines
751 B
JavaScript
Raw Normal View History

2025-11-18 16:01:47 -05:00
import { Router } from "express";
2026-01-20 23:07:31 +00:00
import { isAllowed } from "../../middleware/isAllowed.js";
2025-11-18 16:01:47 -05:00
class IncidentRoutes {
constructor(incidentController) {
this.router = Router();
this.incidentController = incidentController;
this.initRoutes();
}
initRoutes() {
// Team routes
this.router.get("/team", this.incidentController.getIncidentsByTeam);
this.router.get("/team/summary", this.incidentController.getIncidentSummary);
// Individual incident routes
this.router.get("/:incidentId", this.incidentController.getIncidentById);
this.router.put("/:incidentId/resolve", isAllowed(["admin", "superadmin"]), this.incidentController.resolveIncidentManually);
}
getRouter() {
return this.router;
}
}
export default IncidentRoutes;