import { Router } from 'express';
import { auth } from '../../middleware/auth';
import {
  getActiveAnnouncement,
  createAnnouncement,
  updateAnnouncement,
  deleteAnnouncement,
  getAllAnnouncements
} from './controllers/announcements';

const router = Router();

router.get('/active', getActiveAnnouncement);

router.get('/', auth, getAllAnnouncements);
router.post('/', auth, createAnnouncement);
router.put('/:id', auth, updateAnnouncement);
router.delete('/:id', auth, deleteAnnouncement);

export default router;
