From 671ec8532c9f1f89b571ef356e616004f88dd180 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 17 Nov 2014 23:32:39 -0500 Subject: [PATCH] fix unfavourite --- src/database/mongo/sets.js | 8 +++++--- src/database/redis/sets.js | 8 +++++--- src/socket.io/posts.js | 32 ++++++++++++++------------------ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/database/mongo/sets.js b/src/database/mongo/sets.js index 210c3ad2fe..208e380a12 100644 --- a/src/database/mongo/sets.js +++ b/src/database/mongo/sets.js @@ -24,7 +24,7 @@ module.exports = function(db, module) { }, { upsert: true, w: 1 - }, function(err) { + }, function(err, res) { callback(err); }); }; @@ -54,7 +54,7 @@ module.exports = function(db, module) { }}); } - bulk.execute(function(err) { + bulk.execute(function(err, res) { callback(err); }); }; @@ -69,7 +69,9 @@ module.exports = function(db, module) { array[index] = helpers.valueToString(element); }); - db.collection('objects').update({_key: key}, {$pullAll: {members: value}}, callback); + db.collection('objects').update({_key: key}, {$pullAll: {members: value}}, function(err, res) { + callback(err); + }); }; module.setsRemove = function(keys, value, callback) { diff --git a/src/database/redis/sets.js b/src/database/redis/sets.js index 9148dd34f8..53ac5b0d07 100644 --- a/src/database/redis/sets.js +++ b/src/database/redis/sets.js @@ -3,7 +3,7 @@ module.exports = function(redisClient, module) { module.setAdd = function(key, value, callback) { callback = callback || function() {}; - redisClient.sadd(key, value, function(err) { + redisClient.sadd(key, value, function(err, res) { callback(err); }); }; @@ -14,13 +14,15 @@ module.exports = function(redisClient, module) { for (var i=0; i