client/topics.js refactor

ability to dismiss all flags
This commit is contained in:
barisusakli
2014-11-18 14:33:14 -05:00
parent 78033dbf5c
commit d0bc5ec9c7
8 changed files with 300 additions and 258 deletions

View File

@@ -27,6 +27,9 @@ module.exports = function(Posts) {
},
function(next) {
removeFromCategoryRecentPosts(pid, postData.tid, next);
},
function(next) {
db.sortedSetRemove('posts:flagged', pid, next);
}
], function(err) {
callback(err, postData);

View File

@@ -39,6 +39,10 @@ module.exports = function(Posts) {
});
};
Posts.dismissAllFlags = function(callback) {
db.delete('posts:flagged', callback);
};
Posts.getFlags = function(uid, start, end, callback) {
db.getSortedSetRevRange('posts:flagged', start, end, function(err, pids) {
if (err) {