mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
prevent double callback
This commit is contained in:
@@ -694,8 +694,14 @@ var async = require('async'),
|
|||||||
|
|
||||||
Groups.acceptMembership = function(groupName, uid, callback) {
|
Groups.acceptMembership = function(groupName, uid, callback) {
|
||||||
// Note: For simplicity, this method intentially doesn't check the caller uid for ownership!
|
// Note: For simplicity, this method intentially doesn't check the caller uid for ownership!
|
||||||
db.setRemove('group:' + groupName + ':pending', uid, callback);
|
async.waterfall([
|
||||||
Groups.join.apply(Groups, arguments);
|
function(next) {
|
||||||
|
db.setRemove('group:' + groupName + ':pending', uid, next);
|
||||||
|
},
|
||||||
|
function(next) {
|
||||||
|
Groups.join(groupName, uid, next);
|
||||||
|
}
|
||||||
|
], callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
Groups.rejectMembership = function(groupName, uid, callback) {
|
Groups.rejectMembership = function(groupName, uid, callback) {
|
||||||
|
|||||||
Reference in New Issue
Block a user