const express = require('express');
const RolesController = require('../controllers/roles.controller');
const verifyToken = require("../middleware/verifyToken")
const verifyAccess = require("../middleware/verifyAccess")

const router = express.Router();

router.route("/")
    .get(verifyToken.verifyAccessToken, RolesController.getAll)
    .post(verifyToken.verifyAccessToken, verifyAccess(), RolesController.create);

router.route("/:id")
    .get(verifyToken.verifyAccessToken, RolesController.getById)
    .put(verifyToken.verifyAccessToken, verifyAccess(), RolesController.update)
    .delete(verifyToken.verifyAccessToken, verifyAccess(), RolesController.delete);

module.exports = router;