diff --git a/db.js b/db.js index b53859c..8715330 100644 --- a/db.js +++ b/db.js @@ -41,12 +41,14 @@ module.exports = function(name){ }; this.set_v = function(cid,v){ + this.get_chat(cid); return new Promise((resolve, reject)=>{ resolve(this.db.get("chats").find({id:cid}).set('tracking',v).write()); }); }; this.get_v = function(cid){ + this.get_chat(cid); return new Promise((resolve, reject)=>{ resolve(this.db.get("chats").find({id:cid}).value()); });