const express = require('express');
const { protect } = require('../middleware/auth');
const {
  createTicket,
  getTickets,
  getTicketById,
  updateTicket,
  deleteTicket
} = require('../controllers/ticketController');

const router = express.Router();
router.route('/')
  .get(protect, getTickets)
  .post(protect, createTicket);
router.route('/:id')
  .get(protect, getTicketById)
  .put(protect, updateTicket)
  .delete(protect, deleteTicket);

module.exports = router;