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

const router = express.Router();

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

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

module.exports = router;