nl_tokens: save posted data for Form Component from model
pl_tokens: function ( res , scContent , post , cb ) { let model = this . _modelInfo ( scContent [ 'forModel' ] ) ; // get list of expected model props let fields = this . makeFormFields ( res , scContent ) ; let data = { } ; let where = null ; _ . forEach ( fields , function ( val ) { if ( val . isId ) { if ( post [ val . <mask> ] ) where = { [ val . name ] : post [ val . name ] } } else if ( val . name in post ) { if ( val . embedIn ) { data [ val . embedIn ] = Object . assign ( { } , data [ val . embedIn ] , { [ val . name ] : post [ val . name ] } ) ; } else data [ val . name ] = post [ val . name ] ; } } ) ; // add forceVals if ( scContent . forceVals ) { _ . forEach ( scContent . forceVals , function ( val , key ) { data [ key ] = val ; } ) ; } // save data if ( where ) { // update existing model . model . upsertWithWhere ( where , data , ( err , inst ) => { cb ( err , inst ) ; } ) ; } else { model . model . create ( data , ( err , inst ) => { cb ( err , inst ) ; } ) ; } }