if group search is executed with empty string, return all groups

v1.18.x
Julian Lam 10 years ago
parent 5fe69e0386
commit 2a6de59277

@ -878,8 +878,8 @@ var async = require('async'),
};
Groups.search = function(query, options, callback) {
if (!query || !query.length) {
return callback(null, []);
if (!query) {
query = '';
}
async.waterfall([

@ -127,11 +127,11 @@ SocketGroups.delete = function(socket, data, callback) {
};
SocketGroups.search = function(socket, data, callback) {
if (!data || !data.query) {
if (!data) {
return callback(null, []);
}
groups.search(data.query, data.options || {}, callback);
groups.search(data.query || '', data.options || {}, callback);
};
SocketGroups.cover = {};

Loading…
Cancel
Save