fix(backend): include EpisodeSeen in season episodes and add entry credits endpoint
- Add getEntryCredits service method returning all cast + crew with People, ordered by cast_type, order, episode_count - Add getEntryCredits controller method - Add GET /entries/:id/credits route in entry.routes.js - Include EpisodeSeen association in getSeasonEpisodes so seen dates are returned to frontend
This commit is contained in:
1 parent
e460290b9b
commit
22d111ef71
7 files changed
+51
-3
No files matched your search
@@ -1,4 +1,5 @@
|
||||
const Episode = require("../models/Episode");
|
||||
const EpisodeSeen = require("../models/EpisodeSeen");
|
||||
const Season = require("../models/Season");
|
||||
|
||||
|
||||
@@ -53,7 +54,12 @@ class SeasonController {
|
||||
const episodes = await Episode.findAll({
|
||||
where: {
|
||||
season_id: req.params.id
|
||||
}
|
||||
},
|
||||
include: [{ model: EpisodeSeen }],
|
||||
order: [
|
||||
['episode_number', 'ASC'],
|
||||
[EpisodeSeen, 'date_seen', 'ASC'],
|
||||
],
|
||||
});
|
||||
|
||||
if (episodes) {
|
||||
|
||||
Reference in new issue
Block a user