const express = require('express');
const router = express.Router();
const { protect, admin } = require('../middleware/auth');
const {
  addDepartment,
  getDepartments,
  updateDepartment,
  deleteDepartment,
} = require('../controllers/departmentController');

router.use(protect);
router.post('/add', admin, addDepartment);
router.get('/list', getDepartments);
router.put('/:id', admin, updateDepartment);
router.delete('/:id', admin, deleteDepartment);

module.exports = router;
