pass array to groups.destroy

pass array to db.sortedSetRemove
This commit is contained in:
Barış Soner Uşaklı
2018-03-17 19:55:23 -04:00
parent 55b872fe3e
commit fde44cb9b9
3 changed files with 27 additions and 13 deletions

View File

@@ -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);