odstranil vracanje mongodb id
This commit is contained in:
parent
7651dd290a
commit
580c744c26
@ -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' });
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user