Skip to content

Commit

Permalink
filter by has_required_contacts status
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 15, 2021
1 parent 93b5208 commit c80cf20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def index
organization_type: params[:organization_type],
focus_area: params[:focus_area],
non_profit_status: params[:non_profit_status],
has_required_contacts: params[:has_required_contacts],
include_deleted: params[:include_deleted],
page: page,
sort: sort,
Expand Down
1 change: 1 addition & 0 deletions app/controllers/v3/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def index
organization_type: params[:organization_type],
focus_area: params[:focus_area],
non_profit_status: params[:non_profit_status],
has_required_contacts: params[:has_required_contacts],
page: page,
sort: sort,
)
Expand Down
3 changes: 3 additions & 0 deletions app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ def query(query, options = {})
if options[:non_profit_status].present?
filter << { term: { non_profit_status: options[:non_profit_status] } }
end
if options[:has_required_contacts].present?
filter << { term: { has_required_contacts: options[:has_required_contacts] } }
end
if options[:focus_area].present?
filter << { terms: { focus_area: options[:focus_area].split(",") } }
end
Expand Down

0 comments on commit c80cf20

Please sign in to comment.