how can i do that?

9 views
Skip to first unread message

Cristtopher Quintana

unread,
Apr 28, 2016, 4:16:27 PM4/28/16
to StrongLoop

Model.observe('before save', function(ctx, next) {

    var variable = false;
    Model.findOne({
        where: { fullname: ctx.instance.fullname },
        order: 'id DESC'},
        function (err, last) {
            // how can i set?
            variable = true;
        }
    );
 
    next();
});



Thanks for you time.
Reply all
Reply to author
Forward
0 new messages