Skip to content
Browse files

Add filtering support to the server

  • Loading branch information...
1 parent 81946ca commit 269cb4687df10836ccc364f1658a34de4ad11a66 @rixth rixth committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/soulmate/server.rb
View
3 lib/soulmate/server.rb
@@ -24,7 +24,8 @@ class Server < Sinatra::Base
results = {}
types.each do |type|
matcher = Matcher.new(type)
- results[type] = matcher.matches_for_term(term, :limit => limit)
+ filters = params[:filters] && params[:filters][type] ? params[:filters][type] : {}
+ results[type] = matcher.matches_for_term(term, :limit => limit, :filters => filters)
end
JSON.pretty_generate({

0 comments on commit 269cb46

Please sign in to comment.
Something went wrong with that request. Please try again.