fixes removePostFromTopic

remove the pid from the votes set too
This commit is contained in:
barisusakli
2014-06-07 13:04:30 -04:00
parent bf04749f5e
commit b7f71ca0b4
2 changed files with 13 additions and 6 deletions

View File

@@ -131,7 +131,14 @@ module.exports = function(Topics) {
};
Topics.removePostFromTopic = function(tid, pid, callback) {
db.sortedSetRemove('tid:' + tid + ':posts', pid, callback);
async.parallel([
function (next) {
db.sortedSetRemove('tid:' + tid + ':posts', pid, next);
},
function (next) {
db.sortedSetRemove('tid:' + tid + ':posts:votes', pid, next);
}
], callback);
};
Topics.getPids = function(tid, callback) {