got all serverside tests to pass

This commit is contained in:
David Baldwynn 2017-11-15 11:45:39 -08:00
parent 995e94f7f5
commit 29633b0b8b

View file

@ -265,9 +265,11 @@ function formFieldsAllHaveIds(form_fields){
}
FormSchema.pre('save', function (next) {
this.form_fields = this.form_fields.filter(function(field){
return !field.deletePreserved;
});
if(this.form_fields && this.form_fields.length){
this.form_fields = this.form_fields.filter(function(field){
return !field.deletePreserved;
});
}
next();
});