diff --git a/controllers/movieController.js b/controllers/movieController.js index 716c271..2687c27 100644 --- a/controllers/movieController.js +++ b/controllers/movieController.js @@ -12,7 +12,7 @@ module.exports = { * movieController.list() */ list: function (req, res) { - MovieModel.find() + MovieModel.find({}, {_id: 0, __v: 0}) .then(movies => { return res.json(movies); }) @@ -59,7 +59,7 @@ module.exports = { }); const savedMovie = await movie.save(); - return res.status(201).json(savedMovie); + return res.status(201).json(movie); } catch (err) { return res.status(500).json({ message: 'Error when creating movie' }); }