Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit d67a7d0

Browse files
feat: return the updated item after end was set
1 parent 20535c9 commit d67a7d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/items/my-offered-items.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports.setEnd = function (req, res, next) {
7171
updatedAt: Date.now()
7272
};
7373

74-
Item.findByIdAndUpdate(req.params.id, updateQuery, {new: false}).lean().populate(populateFields).exec(function (err, item) {
74+
Item.findByIdAndUpdate(req.params.id, updateQuery, {new: true}).lean().populate(populateFields).exec(function (err, item) {
7575
if (err) {
7676
res.status(500).json({
7777
error: "There was a problem change the end date of the item in the database: " + err

0 commit comments

Comments
 (0)