send response only if modified or drop

This commit is contained in:
Matteo Pagliazzi 2013-09-20 16:01:09 +02:00
parent 3b273dadee
commit 0c0e0834be

View file

@ -710,7 +710,14 @@ api.batchUpdate = function(req, res, next) {
response = user.toJSON();
response.wasModified = res.locals.wasModified;
if (response._tmp && response._tmp.drop) response.wasModified = true;
res.json(200, response);
// Send the response to the server
if(response.wasModified){
res.json(200, response);
}else{
res.json(204);
}
return console.log("Reply sent");
});
};