From b22c95adc2d8dd7fdefcc59e0b2ab2a022b17675 Mon Sep 17 00:00:00 2001 From: X4Lo Date: Mon, 1 Apr 2024 21:15:48 +0000 Subject: [PATCH] renamed the entry router --- backend/routes/{entry.js => entryRoutes.js} | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) rename backend/routes/{entry.js => entryRoutes.js} (90%) diff --git a/backend/routes/entry.js b/backend/routes/entryRoutes.js similarity index 90% rename from backend/routes/entry.js rename to backend/routes/entryRoutes.js index 69546c1..cb657db 100644 --- a/backend/routes/entry.js +++ b/backend/routes/entryRoutes.js @@ -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;