2020-10-12 17:51:35 +02:00
|
|
|
const express = require("express");
|
|
|
|
const router = express.Router();
|
|
|
|
|
|
|
|
const auth = require("../middleware/authAdmin");
|
|
|
|
|
|
|
|
const groupCtrl = require("../controllers/group");
|
|
|
|
|
|
|
|
router.post("/search", auth, groupCtrl.searchGroups);
|
|
|
|
router.post("/", auth, groupCtrl.create);
|
|
|
|
router.get("/stats", auth, groupCtrl.getStatsGroups);
|
|
|
|
router.put("/:id", auth, groupCtrl.modify);
|
|
|
|
router.delete("/:id", auth, groupCtrl.delete);
|
|
|
|
router.get("/get/:id", auth, groupCtrl.getOneById);
|
2020-10-20 11:01:52 +02:00
|
|
|
router.get("/preview/:id/:token", groupCtrl.showOneGroupById);// prévisualisation HTML, même si groupe "incomplet"
|
2020-10-12 17:51:35 +02:00
|
|
|
|
|
|
|
module.exports = router;
|