const { authJwt } = require("../middlewares");
module.exports = app => {
    const controller = require("../controllers/calendar-event-recur.controller.js");
    app.use((req, res, next) => {
      res.header(
        "Access-Control-Allow-Headers",
        "x-access-token, Origin, Content-Type, Accept"
      );
      next();
    });
    var router = require("express").Router();
    router.get("/", [authJwt.verifyToken], controller.getAll);
    router.post("/", [authJwt.verifyToken], controller.create);
    router.get("/:id", [authJwt.verifyToken], controller.getOne);
    router.put("/:id", [authJwt.verifyToken], controller.update);
    router.put("/:id/disable", [authJwt.verifyToken], controller.disable);
    router.delete("/:id", [authJwt.verifyToken], controller.delete);
    app.use('/api/event-recurrences', router);
};
