mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-07 13:03:12 +02:00
client/topics.js refactor
ability to dismiss all flags
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user