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

const router = express.Router();

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

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

module.exports = router;