Backend: Added PUT /seasons/:id/refresh endpoint that fetches updated TMDB data for a single season. Frontend: - New SeasonRatingDialog for rating seasons via StarRating - useRefreshSeason and useUpdateSeason hooks with query invalidation - SeasonPage now shows inline season rating (user + TMDB) - Mark Watched, Rate, and Refresh actions moved under a dropdown menu
29 lines
860 B
JavaScript
29 lines
860 B
JavaScript
const express = require("express");
|
|
const seasonRouter = express.Router();
|
|
|
|
const seasonController = require("../controllers/seasonController");
|
|
|
|
// ! /seasons
|
|
// * POST - Create a new season
|
|
seasonRouter.post("/", seasonController.createSeason);
|
|
|
|
// * GET - Retrieve all seasons
|
|
seasonRouter.get("/", seasonController.getSeasons);
|
|
|
|
// * GET - Retrieve a specific season by id
|
|
seasonRouter.get("/:id", seasonController.getSeaonById);
|
|
|
|
// * GET - Retrieve episodes of a season
|
|
seasonRouter.get("/:id/episodes", seasonController.getSeasonEpisodes);
|
|
|
|
// * PUT - Update a season
|
|
seasonRouter.put("/:id", seasonController.updateSeason);
|
|
|
|
// * PUT - Refresh a season from TMDB
|
|
seasonRouter.put("/:id/refresh", seasonController.refreshSeason);
|
|
|
|
// * DELETE - Delete a season
|
|
seasonRouter.delete("/:id", seasonController.deleteSeason);
|
|
|
|
module.exports = seasonRouter;
|