Updating an Object

89 views
Skip to first unread message

Poliane Brito

unread,
Oct 22, 2013, 1:47:18 PM10/22/13
to persis...@googlegroups.com
Hello,

I'm tryng to updating an object but I'm have no success with it. Can someone help me?

updateAccountOffline: function(data, cb){
            account.getAll(['account', '=', data.account], function(acc){
                if(acc.length == 0){
                    account.add({account: data.account, password: data.password, unique: new Date().getTime()}, cb);
                } else {
                    if(acc.password != data.password){
                        account.update(cb);
                    } else {
                        cb();
                    }
                }
            });
        },


at account.update function

update: function(cb){
            persistence.flush(cb);
        },

Zef Hemel

unread,
Oct 23, 2013, 5:48:57 AM10/23/13
to persis...@googlegroups.com
Where are you doing the actual updating? Your update function just flushes it doesn't change the acc object at all.

-- Zef


--
You received this message because you are subscribed to the Google Groups "persistence.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to persistencej...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages