cmbf-hapi-restmodel
Advanced tools
Comparing version 0.6.12 to 0.6.13
@@ -158,3 +158,3 @@ var Joi = require('joi'), | ||
save(data, options) { | ||
data = data || this; | ||
data = data || this.toJSON(); | ||
log.debug("Save", data[this.constructor.idField] || this[this.constructor.idField]); | ||
@@ -171,7 +171,7 @@ options = options || {upsert: false}; | ||
var fieldsToRemove = _.pickBy(this.toJSON(), function (val) { | ||
var fieldsToRemove = _.pickBy(data, function (val) { | ||
return _.isNull(val); | ||
}); | ||
var fieldsToUpdate = _.omitBy(this.toJSON(), function (val, key) { | ||
var fieldsToUpdate = _.omitBy(data, function (val, key) { | ||
return key === _this.constructor.idField || _.isNull(val); | ||
@@ -178,0 +178,0 @@ }); |
{ | ||
"name": "cmbf-hapi-restmodel", | ||
"version": "0.6.12", | ||
"version": "0.6.13", | ||
"author": "Joel Grenon <joelgrenon@covistra.com>", | ||
@@ -5,0 +5,0 @@ "description": "Hapi plugin building a REST Api from Joi schema, backed by covistra-mongo plugin", |
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
42061