const express = require('express');
const BrandSparepartController = require('../controllers/brand_sparepart.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, BrandSparepartController.getAll)
  .post(verifyToken.verifyAccessToken, verifyAccess(), upload.single('path_foto')
, BrandSparepartController.create);

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

module.exports = router;