Skip to content

Commit

Permalink
postProcess hook is not called when modifying objects
Browse files Browse the repository at this point in the history
  • Loading branch information
florianholzapfel committed Sep 11, 2013
1 parent d2fcdab commit a7b9c84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/express-restify-mongoose.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ var restify = function (app, model, options) {
});
}

function modifyObject(req, res) {
function modifyObject(req, res, next) {
delete req.body._id;
if (model.schema.options.versionKey) {
delete req.body[model.schema.options.versionKey];
Expand All @@ -275,6 +275,7 @@ var restify = function (app, model, options) {
item = filterItem(item, model, exclude);
}
outputFn(res, item);
next();
}
});
}
Expand Down Expand Up @@ -332,6 +333,7 @@ var restify = function (app, model, options) {
item = filterItem(item, model, exclude);
}
outputFn(res, item);
next();
}
});
}, postProcess);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "express-restify-mongoose",
"description": "Easily restify mongoose database",
"version": "0.3.2",
"version": "0.3.3",
"author": {
"name": "Florian Holzapfel",
"email": "[email protected]"
Expand Down

0 comments on commit a7b9c84

Please sign in to comment.