File tree 1 file changed +3
-0
lines changed
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { get , set , each } from "lodash" ;
2
2
3
+ // Create a new model by schema default values
3
4
module . exports . createDefaultObject = function ( schema , obj = { } ) {
4
5
each ( schema . fields , ( field ) => {
5
6
if ( get ( obj , field . model ) === undefined && field . default !== undefined )
@@ -8,6 +9,7 @@ module.exports.createDefaultObject = function (schema, obj = {}){
8
9
return obj ;
9
10
} ;
10
11
12
+ // Get a new model which contains only properties of multi-edit fields
11
13
module . exports . getMultipleFields = function ( schema ) {
12
14
let res = [ ] ;
13
15
each ( schema . fields , ( field ) => {
@@ -18,6 +20,7 @@ module.exports.getMultipleFields = function(schema) {
18
20
return res ;
19
21
} ;
20
22
23
+ // Merge many models to one 'work model' by schema
21
24
module . exports . mergeMultiObjectFields = function ( schema , objs ) {
22
25
let model = { } ;
23
26
You can’t perform that action at this time.
0 commit comments