mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +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) { | 	Groups.search = function(query, options, callback) { | ||||||
| 		if (!query || !query.length) { | 		if (!query) { | ||||||
| 			return callback(null, []); | 			query = ''; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		async.waterfall([ | 		async.waterfall([ | ||||||
|   | |||||||
| @@ -127,11 +127,11 @@ SocketGroups.delete = function(socket, data, callback) { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| SocketGroups.search = function(socket, data, callback) { | SocketGroups.search = function(socket, data, callback) { | ||||||
| 	if (!data || !data.query) { | 	if (!data) { | ||||||
| 		return callback(null, []); | 		return callback(null, []); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	groups.search(data.query, data.options || {}, callback); | 	groups.search(data.query || '', data.options || {}, callback); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| SocketGroups.cover = {}; | SocketGroups.cover = {}; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user