Migrate tests to ESM
This commit is contained in:
1 parent
f057807b56
commit
896b3437e5
22 files changed
+1153
-238
No files matched your search
@@ -1,53 +1,43 @@
|
||||
import { Router } from "express";
|
||||
import monitorController from "../controllers/monitorController.js";
|
||||
import {
|
||||
getAllMonitors,
|
||||
getMonitorStatsById,
|
||||
getMonitorCertificate,
|
||||
getMonitorById,
|
||||
getMonitorsAndSummaryByTeamId,
|
||||
getMonitorsByTeamId,
|
||||
createMonitor,
|
||||
deleteMonitor,
|
||||
deleteAllMonitors,
|
||||
editMonitor,
|
||||
pauseMonitor,
|
||||
addDemoMonitors,
|
||||
} from "../controllers/monitorController.js";
|
||||
import { isAllowed } from "../middleware/isAllowed.js";
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get("/", monitorController.getAllMonitors);
|
||||
router.get("/stats/:monitorId", monitorController.getMonitorStatsById);
|
||||
router.get("/certificate/:monitorId", monitorController.getMonitorCertificate);
|
||||
router.get("/:monitorId", monitorController.getMonitorById);
|
||||
router.get(
|
||||
"/team/summary/:teamId",
|
||||
monitorController.getMonitorsAndSummaryByTeamId
|
||||
);
|
||||
router.get("/team/:teamId", monitorController.getMonitorsByTeamId);
|
||||
router.get("/", getAllMonitors);
|
||||
router.get("/stats/:monitorId", getMonitorStatsById);
|
||||
router.get("/certificate/:monitorId", getMonitorCertificate);
|
||||
router.get("/:monitorId", getMonitorById);
|
||||
router.get("/team/summary/:teamId", getMonitorsAndSummaryByTeamId);
|
||||
router.get("/team/:teamId", getMonitorsByTeamId);
|
||||
|
||||
router.post(
|
||||
"/",
|
||||
isAllowed(["admin", "superadmin"]),
|
||||
monitorController.createMonitor
|
||||
);
|
||||
router.post("/", isAllowed(["admin", "superadmin"]), createMonitor);
|
||||
|
||||
router.delete(
|
||||
"/:monitorId",
|
||||
isAllowed(["admin", "superadmin"]),
|
||||
monitorController.deleteMonitor
|
||||
);
|
||||
router.delete("/:monitorId", isAllowed(["admin", "superadmin"]), deleteMonitor);
|
||||
|
||||
router.put(
|
||||
"/:monitorId",
|
||||
isAllowed(["admin", "superadmin"]),
|
||||
monitorController.editMonitor
|
||||
);
|
||||
router.put("/:monitorId", isAllowed(["admin", "superadmin"]), editMonitor);
|
||||
|
||||
router.delete(
|
||||
"/",
|
||||
isAllowed(["superadmin"]),
|
||||
monitorController.deleteAllMonitors
|
||||
);
|
||||
router.delete("/", isAllowed(["superadmin"]), deleteAllMonitors);
|
||||
|
||||
router.post(
|
||||
"/pause/:monitorId",
|
||||
isAllowed(["admin", "superadmin"]),
|
||||
monitorController.pauseMonitor
|
||||
pauseMonitor
|
||||
);
|
||||
|
||||
router.post(
|
||||
"/demo",
|
||||
isAllowed(["admin", "superadmin"]),
|
||||
monitorController.addDemoMonitors
|
||||
);
|
||||
router.post("/demo", isAllowed(["admin", "superadmin"]), addDemoMonitors);
|
||||
|
||||
export default router;
|
||||
Reference in new issue
Block a user