Skip to content

Commit

Permalink
Fall back to free search text from search box
Browse files Browse the repository at this point in the history
In the case that no categories are selected.
  • Loading branch information
rmacqueen committed Aug 11, 2016
1 parent 9944f77 commit 2d85c9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ exports.search = (req, res) => {
curr_user: req.user,
card_user: item,
}, cb)
}, (err, results) => {
res.json(results);
}, (err, response) => {
res.json(response);
});
});
}
Expand Down
4 changes: 4 additions & 0 deletions public/js/showall.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ document.addEventListener("DOMContentLoaded", function(event) {
var skill_names = $.map($('.category-filter .skill-select .selected'), function (obj) {
return $(obj).attr('name');
});
if (skill_names.length == 0) {
var free_search_text = $('.search-box').val();
skill_names = [free_search_text];
}
$.ajax({
url: '/users/search',
data: {
Expand Down

0 comments on commit 2d85c9c

Please sign in to comment.