Major Backend SI Update part 2: added controllers
This commit is contained in:
1 parent
a51e207707
commit
dbb00fdb61
38 files changed
+2129
-1231
No files matched your search
@@ -1,3 +1,4 @@
|
||||
const EntryRating = require('../models/EntryRating');
|
||||
const collectionManager = require('../services/collectionManager');
|
||||
const entryManager = require('../services/entryManager');
|
||||
const entryService = require("../services/entryService");
|
||||
@@ -49,6 +50,26 @@ class EntryController {
|
||||
res.status(201).json(updatedEntry);
|
||||
}
|
||||
|
||||
// * PUT - ENTRY Ratings UPDATE
|
||||
async updateEntryRatings(req, res) {
|
||||
const { id } = req.params;
|
||||
const { entryRatings } = req.body;
|
||||
|
||||
const updatedEntryRatings = await _entryService.updateEntryRatings(id, entryRatings);
|
||||
|
||||
res.status(200).json(updatedEntryRatings);
|
||||
}
|
||||
|
||||
// * PUT - ENTRY Ratings UPDATE
|
||||
async updateEntryIds(req, res) {
|
||||
const { id } = req.params;
|
||||
const { entryIds } = req.body;
|
||||
|
||||
const updatedEntryIds = await _entryService.updateEntryRatings(id, entryIds);
|
||||
|
||||
res.status(200).json(updatedEntryIds);
|
||||
}
|
||||
|
||||
// * DELETE - ENTRY BY ID
|
||||
async deleteEntry(req, res) {
|
||||
const { id } = req.params;
|
||||
|
||||
Reference in new issue
Block a user