mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
if group search is executed with empty string, return all groups
This commit is contained in:
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user