Skip to content

Commit

Permalink
Search full name on client side
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbrazier committed Apr 23, 2017
1 parent c14d4b3 commit 4f54238
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/rocketchat-ui-sidenav/client/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ Template.toolbar.helpers({
query.t = 'd';
}

query.name = new RegExp((RegExp.escape(filterText)), 'i');
const searchQuery = new RegExp((RegExp.escape(filterText)), 'i');
query.$or = [
{ name: searchQuery },
{ fname: searchQuery }
];

resultsFromClient = collection.find(query, {limit: 20, sort: {unread: -1, ls: -1}}).fetch();

Expand Down

0 comments on commit 4f54238

Please sign in to comment.