const express = require('express');
const BrandController = require('../controllers/brand.controller');
const verifyToken = require('../middleware/verifyToken');
const verifyAccess = require('../middleware/verifyAccess');
const upload = require('../middleware/uploads');

const router = express.Router();

router.route('/')
  .get(verifyToken.verifyAccessToken, BrandController.getAll)
  .post(verifyToken.verifyAccessToken, verifyAccess(), BrandController.create);

router.route('/:id')
  .get(verifyToken.verifyAccessToken, BrandController.getById)
  .put(verifyToken.verifyAccessToken, verifyAccess(), upload.single('file'), BrandController.update)
  .delete(verifyToken.verifyAccessToken, verifyAccess(), BrandController.delete);

module.exports = router;