diff --git a/app/services/hyrax/collections/nested_collection_query_service_decorator.rb b/app/services/hyrax/collections/nested_collection_query_service_decorator.rb new file mode 100644 index 00000000..85839b50 --- /dev/null +++ b/app/services/hyrax/collections/nested_collection_query_service_decorator.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# OVERRIDE Hyrax 5.0 to force GET (for testing) for nested collection queries +# @todo - remove when Hyrax supports POST for nested collection queries +module Hyrax + module Collections + ## + # A query service handling nested collection queries. + module NestedCollectionQueryServiceDecorator + extend ActiveSupport::Concern + + class_methods do + private + + def query_solr(collection:, access:, scope:, limit_to_id:, nest_direction:) + scope.blacklight_config.http_method = :get + super + end + end + end + end +end + +Hyrax::Collections::NestedCollectionQueryService.prepend(Hyrax::Collections::NestedCollectionQueryServiceDecorator)