const express = require('express')
const router = express.Router()
const cityController = require('../../controllers/admin/CityController.js')
const verifyJWT = require('../../middleware/VerifyJWT.js');
const checkRole = require('../../middleware/CheckRole.js');

router.get('/', verifyJWT, checkRole(['admin', 'sales']), cityController.getAllCity);
router.post('/', verifyJWT, checkRole(['admin']), cityController.storeCity);
router.get('/:id', verifyJWT, checkRole(['admin', 'sales']), cityController.showCity);
router.patch('/:id', verifyJWT, checkRole(['admin']), cityController.updateCity);
router.delete('/:id', verifyJWT, checkRole(['admin']), cityController.deleteCity);

module.exports = router;