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;