add media download service and started using it

This commit is contained in:
X4Lo committed 2024-05-18 15:28:42 +01:00
1 parent 78399912f7
commit 06be888123
12 files changed
+614 -80

No files matched your search

+3 -1
View File
@@ -6,6 +6,7 @@ const EntryId = require('../models/EntryId');
const EntryRating = require('../models/EntryRating');
const Season = require('../models/Season');
const Genre = require('../models/Genre');
const Media = require('../models/Media');
const { Sequelize } = require('sequelize');
const router = express.Router();
@@ -51,6 +52,7 @@ router.get('/:id', async (req, res) => {
{ model: EntryId, as: 'entryId' },
{ model: EntryRating, as: 'entryRating' },
{ model: Season, as: 'seasons' },
{ model: Media, as: 'medias' },
{ model: Genre, as: 'genres' },
],
through: {
@@ -203,7 +205,7 @@ router.patch('/:userCollectionId/entries/:entryId', async (req, res) => {
}
// ? updating
const updated = await collectionEntry.update({ order: newOrder });
await collectionEntry.update({ order: newOrder });
res.status(200).json({ message: 'UserCollectionEntry order updated successfully.' });
} catch (error) {