lib/backend/deprecated/controllers/payment-controller-ignore.js
//-- removes temporal items and save them again.
removes temporal items and save them again.
removes temporal items and save them again .
function _save() {
            console.log('syncTransactions - StripeTransaction - removeWhen');
            ctrl('StripeTransaction').removeWhen({
                _user: data._user
            }, (err, r) => {
                console.log('syncTransactions - StripeTransaction - ok?', !err);
                if (err) return cb(err, false);
                var hell = utils.cbHell(transactions.length, () => {
                    console.log('syncTransactions - success');
                    return cb(err, true);
                });
                transactions.forEach((transaction, tx) => {
                    console.log('syncTransactions - StripeTransaction - saving', tx);
                    ctrl('StripeTransaction').save(transaction, (err, r) => {
                        if (err) {
                            LogSave('syncTransactions - StripeTransaction:save', err);
                        }
                        hell.next();
                    });
                });
            })
        }
function _save ( ) { console . log ( 'syncTransactions - StripeTransaction - removeWhen' ) ; ctrl ( 'StripeTransaction' ) . removeWhen ( { _user : data . _user } , ( err , r ) => { console . log ( 'syncTransactions - StripeTransaction - ok?' , ! err ) ; if ( err ) return cb ( err , false ) ; var hell = utils . cbHell ( transactions . length , ( ) => { console . log ( 'syncTransactions - success' ) ; return cb ( err , true ) ; } ) ; transactions . forEach ( ( transaction , tx ) => { console . log ( 'syncTransactions - StripeTransaction - saving' , tx ) ; ctrl ( 'StripeTransaction' ) . save ( transaction , ( err , r ) => { if ( err ) { LogSave ( 'syncTransactions - StripeTransaction:save' , err ) ; } hell . next ( ) ; } ) ; } ) ; } ) }
removes temporal items and save them again.
removes temporal items and save them again .