group.exists([]) fix

v1.18.x
barisusakli 9 years ago
parent c7c503f563
commit 990434476b

@ -311,8 +311,8 @@ var utils = require('../public/src/utils');
return utils.slugify(groupName); return utils.slugify(groupName);
}); });
async.parallel([ async.parallel([
function(next) { function (next) {
callback(null, slugs.map(function(slug) { next(null, slugs.map(function(slug) {
return ephemeralGroups.indexOf(slug) !== -1; return ephemeralGroups.indexOf(slug) !== -1;
})); }));
}, },
@ -321,15 +321,14 @@ var utils = require('../public/src/utils');
if (err) { if (err) {
return callback(err); return callback(err);
} }
callback(null, name.map(function(n, index) {
callback(null, results.map(function(result) { return results[0][index] || results[1][index];
return result[0] || result[1];
})); }));
}); });
} else { } else {
var slug = utils.slugify(name); var slug = utils.slugify(name);
async.parallel([ async.parallel([
function(next) { function (next) {
next(null, ephemeralGroups.indexOf(slug) !== -1); next(null, ephemeralGroups.indexOf(slug) !== -1);
}, },
async.apply(db.isSortedSetMember, 'groups:createtime', name) async.apply(db.isSortedSetMember, 'groups:createtime', name)

Loading…
Cancel
Save