Comparing version 0.4.1 to 0.4.2
@@ -219,3 +219,3 @@ /*jshint camelcase:false */ | ||
} | ||
var itemId = req.params.id || req.body.id; | ||
var itemId = req.body.id || req.params.id; | ||
if (!itemId) { | ||
@@ -267,3 +267,7 @@ return validationError('No "id" field passed'); | ||
return this.entity.readOne(query).then(function(doc){ | ||
return this.entity.readOne(query).then(function(doc) { | ||
if (!doc) { | ||
throw new Error('Network not found, id: ' + req.params.id); | ||
} | ||
// assign the item to the tpl vars. | ||
@@ -424,3 +428,2 @@ res.locals.item = doc; | ||
CrudCmd.prototype._handleReadError = function(req, res, view, err) { | ||
console.log('WTF:', err, view); | ||
if (this.isJson(req)) { | ||
@@ -427,0 +430,0 @@ res.status(401).json(this.jsonError(err)); |
@@ -40,2 +40,2 @@ /** | ||
}; | ||
}; | ||
}; |
{ | ||
"name": "crude", | ||
"description": "Seamless CRUD control operations for node.", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"homepage": "https://github.com/talksession/node-crude", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -33,2 +33,4 @@ # node-crude | ||
- **v0.4.2**, *01 May 2014* | ||
- Check for `req.body.id` first, `req.params.id` second on update. | ||
- **v0.4.1**, *24 Apr 2014* | ||
@@ -35,0 +37,0 @@ - Enable customizable entityCreate op. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40023
1014
106