const { authJwt } = require("../middlewares");

module.exports = app => {
    const templates = require("../controllers/msg-custom-template.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], templates.getAll);
    router.post("/", [authJwt.verifyToken], templates.create);
    router.get("/:id", [authJwt.verifyToken], templates.getOne);
    router.put("/:id", [authJwt.verifyToken], templates.update);
    router.delete("/:id", [authJwt.verifyToken], templates.remove);
    app.use('/api/msg-custom-templates', router);
};
