* Automaticly fixable eslint issues, mostly 3 -> 2 space indentation * fix: updated plex_userid to camelcase * Linted and some consistency refactor on middleware * eslint uses ecmaversion 2020 & allow empty catch rule * Started linting source files * Fixed eslint errors & improved a lot of error handling * Set 2 eslint rules as warning temporarly
23 lines
656 B
JavaScript
23 lines
656 B
JavaScript
const configuration = require("../../../config/configuration").getInstance();
|
|
const TMDB = require("../../../tmdb/tmdb");
|
|
|
|
const tmdb = new TMDB(configuration.get("tmdb", "apiKey"));
|
|
|
|
const personCreditsController = (req, res) => {
|
|
const personId = req.params.id;
|
|
|
|
return tmdb
|
|
.personCredits(personId)
|
|
.then(credits => res.send(credits))
|
|
.catch(error => {
|
|
return res.status(error?.statusCode || 500).send({
|
|
success: false,
|
|
message:
|
|
error?.message ||
|
|
`An unexpected error occured while requesting info for person with id ${personId}.`
|
|
});
|
|
});
|
|
};
|
|
|
|
module.exports = personCreditsController;
|