Class: Qa::Authorities::Collections

Inherits:
Base
  • Object
show all
Defined in:
app/authorities/qa/authorities/collections.rb

Instance Method Summary collapse

Instance Method Details

#search(_q, controller) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'app/authorities/qa/authorities/collections.rb', line 7

def search(_q, controller)
  # The Hyrax::CollectionSearchBuilder expects a current_user
  return [] unless controller.current_user
  response, = search_response(controller)
  docs = response.documents

  docs.map do |doc|
    { id: doc.id, label: doc.title, value: doc.id }
  end
end