This commit is contained in:
2022-01-03 19:06:11 +01:00
parent b5bd672f44
commit be889b8100

View File

@@ -28,12 +28,10 @@ function requestTmdbIdController(req, res) {
let mediaFunction = undefined; let mediaFunction = undefined;
if (id === undefined || type === undefined) { if (id === undefined || type === undefined) {
res res.status(422).send({
.status(422) success: false,
.send({ message: "'Missing parameteres: 'id' and/or 'type'"
success: false, });
message: "'Missing parameteres: 'id' and/or 'type'"
});
} }
if (type === "movie") { if (type === "movie") {
@@ -41,12 +39,10 @@ function requestTmdbIdController(req, res) {
} else if (type === "show") { } else if (type === "show") {
mediaFunction = tmdbShowInfo; mediaFunction = tmdbShowInfo;
} else { } else {
res res.status(422).send({
.status(422) success: false,
.send({ message: 'Incorrect type. Allowed types: "movie" or "show"'
success: false, });
message: 'Incorrect type. Allowed types: "movie" or "show"'
});
} }
mediaFunction(id) mediaFunction(id)