Skip to content

Commit

Permalink
always show all members in providers api. datacite/datacite#725
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 24, 2019
1 parent 0654f36 commit c8a56a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/controllers/members_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def index
elsif params[:ids].present?
response = Provider.find_by_id(params[:ids], page: page, sort: sort)
else
response = Provider.query(params[:query], all_members: true, year: params[:year], region: params[:region], organization_type: params[:organization_type], focus_area: params[:focus_area], fields: params[:fields], page: page, sort: sort)
response = Provider.query(params[:query], year: params[:year], region: params[:region], organization_type: params[:organization_type], focus_area: params[:focus_area], fields: params[:fields], page: page, sort: sort)
end

begin
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def index
elsif params[:ids].present?
response = Provider.find_by_id(params[:ids], page: page, sort: sort)
else
response = Provider.query(params[:query], year: params[:year], region: params[:region], organization_type: params[:organization_type], focus_area: params[:focus_area], all_members: params[:all_members], page: page, sort: sort)
response = Provider.query(params[:query], year: params[:year], region: params[:region], organization_type: params[:organization_type], focus_area: params[:focus_area], page: page, sort: sort)
end

begin
Expand Down
7 changes: 1 addition & 6 deletions app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,7 @@ def query(query, options={})
must << { term: { region: options[:region].upcase }} if options[:region].present?
must << { term: { organization_type: options[:organization_type] }} if options[:organization_type].present?
must << { term: { focus_area: options[:focus_area] }} if options[:focus_area].present?

if options[:all_members]
must << { terms: { role_name: %w( ROLE_FOR_PROFIT_PROVIDER ROLE_CONTRACTUAL_PROVIDER ROLE_CONSORTIUM_LEAD ROLE_ALLOCATOR ROLE_MEMBER) }}
else
must << { terms: { role_name: %w( ROLE_FOR_PROFIT_PROVIDER ROLE_CONTRACTUAL_PROVIDER ROLE_CONSORTIUM_LEAD ROLE_ALLOCATOR) }}
end
must << { terms: { role_name: %w( ROLE_FOR_PROFIT_PROVIDER ROLE_CONTRACTUAL_PROVIDER ROLE_CONSORTIUM_LEAD ROLE_ALLOCATOR ROLE_MEMBER) }}

must_not << { exists: { field: "deleted_at" }} unless options[:include_deleted]
elsif self.name == "Client"
Expand Down

0 comments on commit c8a56a6

Please sign in to comment.