Seasons Page: - Episode watch button now opens EpisodeSeenEditDialog instead of directly marking as watched, allowing date/seen-with input - Added "Mark Season as Watched" button that sequentially marks all unwatched episodes in the season Episode Page: - Fixed UI not updating after deleting the last episode seen record; the backend returns 404 when no records exist for an episode, which caused the query to error instead of resolving to an empty array. The API layer now catches 404 and returns [] gracefully.
26 lines
838 B
JavaScript
26 lines
838 B
JavaScript
const express = require('express');
|
|
const entrySeenRouter = express.Router();
|
|
|
|
const entrySeenController = require('../controllers/entrySeenController');
|
|
|
|
// ! /entry-seen
|
|
// * GET - ALL ENTRY SEEN
|
|
entrySeenRouter.get('/', entrySeenController.getEntrySeens);
|
|
|
|
// * GET - ENTRY SEEN BY ENTRY ID (must be before /:id to avoid conflict)
|
|
entrySeenRouter.get('/by-entry/:entryId', entrySeenController.getEntrySeensByEntryId);
|
|
|
|
// * GET - ENTRY SEEN BY ID
|
|
entrySeenRouter.get('/:id', entrySeenController.getEntrySeenById);
|
|
|
|
// * POST - CREATE ENTRY SEEN
|
|
entrySeenRouter.post('/', entrySeenController.createEntrySeen);
|
|
|
|
// * PUT - UPDATE ENTRY SEEN
|
|
entrySeenRouter.put('/:id', entrySeenController.updateEntrySeen);
|
|
|
|
// * DELETE - ENTRY SEEN
|
|
entrySeenRouter.delete('/:id', entrySeenController.deleteEntrySeen);
|
|
|
|
module.exports = entrySeenRouter;
|