mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
if a group is deleted, flush the owner and pending sets, too
This commit is contained in:
@@ -500,15 +500,11 @@ var async = require('async'),
|
||||
|
||||
Groups.destroy = function(groupName, callback) {
|
||||
async.parallel([
|
||||
function(next) {
|
||||
db.delete('group:' + groupName, next);
|
||||
},
|
||||
function(next) {
|
||||
db.setRemove('groups', groupName, next);
|
||||
},
|
||||
function(next) {
|
||||
db.delete('group:' + groupName + ':members', next);
|
||||
},
|
||||
async.apply(db.delete, 'group:' + groupName),
|
||||
async.apply(db.setRemove, 'groups', groupName),
|
||||
async.apply(db.delete, 'group:' + groupName + ':members'),
|
||||
async.apply(db.delete, 'group:' + groupName + ':pending'),
|
||||
async.apply(db.delete, 'group:' + groupName + ':owners'),
|
||||
function(next) {
|
||||
db.getSetMembers('groups', function(err, groups) {
|
||||
if (err) {
|
||||
|
||||
Reference in New Issue
Block a user