const express = require('express');
const router = express.Router();
const WatcherController = require('../controllers/WatcherController');
const unhashRequestIds = require('../middleware/unhashRequest');

/**
 * Routen für Watcher (Berechtigungen)
 */

// GET /api/watcher - Alle Watcher abrufen
router.get('/', WatcherController.getWatchers.bind(WatcherController));

// POST /api/watcher - Neuen Watcher hinzufügen
router.post('/', WatcherController.addWatcher.bind(WatcherController));

// DELETE /api/watcher/:id - Watcher entfernen
router.delete('/:id', unhashRequestIds, WatcherController.removeWatcher.bind(WatcherController));

module.exports = router;

