@jsmrcaga/executor
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -458,2 +458,6 @@ const undefined_or_null = el => (el === undefined || el === null); | ||
for(let k of missing_keys) { | ||
if(schema[k] instanceof PrimaryKey) { | ||
continue; | ||
} | ||
if(schema[k].defaultValue !== undefined){ | ||
@@ -460,0 +464,0 @@ values[k] = schema[k].get_default(); |
@@ -19,9 +19,12 @@ const Manager = require('./manager'); | ||
// Will fill up "from db" as well | ||
const values = Fields.fillup(this.constructor, params); | ||
if(validate) { | ||
// Validate object | ||
Fields.validate(this, params); | ||
Fields.validate(this, values); | ||
} | ||
// Create PK if needed | ||
let { pk, key } = Fields.get_pk(this, params); | ||
let { pk, key } = Fields.get_pk(this, values); | ||
@@ -34,3 +37,2 @@ this[key] = pk; | ||
// Populate with validation having been performed earlier | ||
const values = Fields.fillup(this.constructor, params); | ||
@@ -37,0 +39,0 @@ for(let [k, v] of Object.entries(values)) { |
{ | ||
"name": "@jsmrcaga/executor", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Simple OR/DM for MongoDB", |
32159
1209