mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
pass array to groups.destroy
pass array to db.sortedSetRemove
This commit is contained in:
@@ -58,9 +58,9 @@ module.exports = function (Categories) {
|
||||
], next);
|
||||
},
|
||||
function (next) {
|
||||
async.eachSeries(privileges.privilegeList, function (privilege, next) {
|
||||
groups.destroy('cid:' + cid + ':privileges:' + privilege, next);
|
||||
}, next);
|
||||
groups.destroy(privileges.privilegeList.map(function (privilege) {
|
||||
return 'cid:' + cid + ':privileges:' + privilege;
|
||||
}), next);
|
||||
},
|
||||
], function (err) {
|
||||
callback(err);
|
||||
|
||||
@@ -96,16 +96,10 @@ function deleteUserNids(nids, uid, callback) {
|
||||
if (!nids.length) {
|
||||
return setImmediate(callback);
|
||||
}
|
||||
async.parallel([
|
||||
function (next) {
|
||||
db.sortedSetRemove('uid:' + uid + ':notifications:read', nids, next);
|
||||
},
|
||||
function (next) {
|
||||
db.sortedSetRemove('uid:' + uid + ':notifications:unread', nids, next);
|
||||
},
|
||||
], function (err) {
|
||||
callback(err);
|
||||
});
|
||||
db.sortedSetRemove([
|
||||
'uid:' + uid + ':notifications:read',
|
||||
'uid:' + uid + ':notifications:unread',
|
||||
], nids, callback);
|
||||
}
|
||||
|
||||
function getNotifications(uid, start, stop, callback) {
|
||||
|
||||
Reference in New Issue
Block a user