File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 11import { get , set , each } from "lodash" ;
22
3+ // Create a new model by schema default values
34module . exports . createDefaultObject = function ( schema , obj = { } ) {
45 each ( schema . fields , ( field ) => {
56 if ( get ( obj , field . model ) === undefined && field . default !== undefined )
@@ -8,6 +9,7 @@ module.exports.createDefaultObject = function (schema, obj = {}){
89 return obj ;
910} ;
1011
12+ // Get a new model which contains only properties of multi-edit fields
1113module . exports . getMultipleFields = function ( schema ) {
1214 let res = [ ] ;
1315 each ( schema . fields , ( field ) => {
@@ -18,6 +20,7 @@ module.exports.getMultipleFields = function(schema) {
1820 return res ;
1921} ;
2022
23+ // Merge many models to one 'work model' by schema
2124module . exports . mergeMultiObjectFields = function ( schema , objs ) {
2225 let model = { } ;
2326
You can’t perform that action at this time.
0 commit comments