mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
update, create, destroy hooks, #2609
This commit is contained in:
@@ -428,7 +428,15 @@ var async = require('async'),
|
||||
tasks.push(async.apply(db.setAdd, 'group:' + data.name + ':members', data.ownerUid));
|
||||
}
|
||||
|
||||
async.parallel(tasks, callback);
|
||||
async.parallel(tasks, function(err) {
|
||||
if (!err) {
|
||||
plugins.fireHook('action:group.create', {
|
||||
name: data.name
|
||||
});
|
||||
}
|
||||
|
||||
callback(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -458,7 +466,7 @@ var async = require('async'),
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
plugins.fireHook('action:group.updated', {
|
||||
plugins.fireHook('action:group.update', {
|
||||
name: groupName,
|
||||
values: payload
|
||||
});
|
||||
@@ -564,7 +572,15 @@ var async = require('async'),
|
||||
}, next);
|
||||
});
|
||||
}
|
||||
], callback);
|
||||
], function(err) {
|
||||
if (!err) {
|
||||
plugins.fireHook('action:group.destroy', {
|
||||
name: groupName
|
||||
});
|
||||
}
|
||||
|
||||
callback(err);
|
||||
});
|
||||
};
|
||||
|
||||
Groups.join = function(groupName, uid, callback) {
|
||||
|
||||
Reference in New Issue
Block a user