Moved contents of seasoned_api up to root folder

This commit is contained in:
2022-08-19 01:03:27 +02:00
parent 0efc109992
commit 56262a45c8
134 changed files with 885 additions and 32 deletions

View File

@@ -0,0 +1,22 @@
const RequestRepository = require("../../../request/request");
const request = new RequestRepository();
/**
* Controller: Get requested item by tmdb id and type
* @param {Request} req http request variable
* @param {Response} res
* @returns {Callback}
*/
function fetchAllRequests(req, res) {
const id = req.params.id;
const { type } = req.query;
request
.getRequestByIdAndType(id, type)
.then(result => res.send(result))
.catch(error => {
res.status(404).send({ success: false, message: error.message });
});
}
module.exports = fetchAllRequests;