Add watcher routes to backend and frontend; implement routing and UI components for watcher management

This commit is contained in:
Torsten Schulz (local)
2025-10-17 23:50:25 +02:00
parent c7a0316ca0
commit ac3720fb61
12 changed files with 750 additions and 10 deletions

View File

@@ -0,0 +1,20 @@
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;