Comparing version 0.3.4 to 0.3.5
@@ -235,3 +235,19 @@ /*jshint camelcase:false */ | ||
CrudCmd.prototype._delete = function(req, res){ | ||
res.send('NOT IMPLEMENTED'); | ||
var query = new Object(null); | ||
query[this.opts.urlField] = req.params.id; | ||
var self = this; | ||
return this.entity.delete(query) | ||
.then(function() { | ||
if (self.isJson(req)) { | ||
return res.json(200); | ||
} | ||
self.addSuccess(res); | ||
res.redirect(self.getBaseUrl(req)); | ||
}).catch(function(err) { | ||
if (self.isJson(req)) { | ||
return res.json(400, err); | ||
} | ||
self.addFlashError(req, err); | ||
res.redirect(self.getBaseUrl(req)); | ||
}); | ||
}; | ||
@@ -238,0 +254,0 @@ |
{ | ||
"name": "crude", | ||
"description": "Seamless CRUD control operations for node.", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"homepage": "https://github.com/talksession/node-crude", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -32,2 +32,4 @@ # node-crude | ||
## Release History | ||
- **v0.3.5**, *23 Feb 2014* | ||
- Implement DELETE, about time. | ||
- **v0.3.4**, *23 Feb 2014* | ||
@@ -34,0 +36,0 @@ - Fix symbol bug. |
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
33672
852
79
9