// @ts-check
const express = require('express');
const router = express.Router();
const { ah } = require('../middleware/asyncHandler');
const { listEvents, createEvent, updateEvent, deleteEvent } = require('../controllers/events.controller');

router.get('/', ah(listEvents));
router.post('/', ah(createEvent));
router.put('/:id', ah(updateEvent));
router.delete('/:id', ah(deleteEvent));

module.exports = router;