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
+4 -5
@@ -5,9 +5,8 @@ const EntryId = require('../models/EntryId');
const EntryRating = require('../models/EntryRating'); const EntryRating = require('../models/EntryRating');
const router = express.Router(); const router = express.Router();
// ! entries/ // ! /entries
// * GET - ALL ENTRIES
// ? GET all entries
router.get('/', async (req, res) => { router.get('/', async (req, res) => {
const { page, pageSize } = req.body; const { page, pageSize } = req.body;
@@ -21,7 +20,7 @@ router.get('/', async (req, res) => {
res.status(200).json(entries); res.status(200).json(entries);
}); });
// ? POST a new entry // * POST - CREATE ENTRY
router.post('/', async (req, res) => { router.post('/', async (req, res) => {
const { tmdb_id, is_tvserie } = req.body; const { tmdb_id, is_tvserie } = req.body;
@@ -30,7 +29,7 @@ router.post('/', async (req, res) => {
res.status(201).json(entry); res.status(201).json(entry);
}); });
// ! DELETE an entry by ID // * DELETE - ENTRY BY ID
router.delete('/:id', async (req, res) => { router.delete('/:id', async (req, res) => {
const { id } = req.params; const { id } = req.params;