Class: Qa::Authorities::FindWorks

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

Instance Method Summary collapse

Instance Method Details

#search(_q, controller) ⇒ Object


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

def search(_q, controller)
  # The My::FindWorksSearchBuilder expects a current_user
  return [] unless controller.current_user

  response, _docs = search_response(controller)
  docs = response.documents
  docs.map do |doc|
    id = doc.id
    title = doc.title
    { id: id, label: title, value: id }
  end
end