renamed the entry router

This commit is contained in:
X4Lo committed 2024-04-01 21:15:48 +00:00
1 parent bf0378e895
commit b22c95adc2
1 file changed
+5 -6
@@ -5,15 +5,14 @@ const EntryId = require('../models/EntryId');
const EntryRating = require('../models/EntryRating');
const router = express.Router();
// ! entries/
// ? GET all entries
// ! /entries
// * GET - ALL ENTRIES
router.get('/', async (req, res) => {
const { page, pageSize } = req.body;
const entries = await Entry.findAll({
include: [
{ model: EntryId, as: 'entryId' },
{ model: EntryId, as: 'entryId' },
{ model: EntryRating, as: 'entryRating' }
]
});
@@ -21,7 +20,7 @@ router.get('/', async (req, res) => {
res.status(200).json(entries);
});
// ? POST a new entry
// * POST - CREATE ENTRY
router.post('/', async (req, res) => {
const { tmdb_id, is_tvserie } = req.body;
@@ -30,7 +29,7 @@ router.post('/', async (req, res) => {
res.status(201).json(entry);
});
// ! DELETE an entry by ID
// * DELETE - ENTRY BY ID
router.delete('/:id', async (req, res) => {
const { id } = req.params;