# frozen_string_literal: true class AnnotationReflex < ApplicationReflex include DocumentSearch include AnnotationSearch def render_document_search_results(search_params) search = document_search(search_params) @documents = search.results opts = { current_page: search_params[:page], q: search_params[:q] } morph "#annotatedDocumentsSearchResults", render(partial: "/shared/annotated_documents_search_results", locals: { documents: @documents, opts: opts }) end def render_annotations_views(search_params) search = annotation_search(search_params) @annotations = search.results morph "#annotationsIndexView", render(partial: "/shared/annotations_index_view", locals: { annotations: @annotations, opts: { doctrine_id: search_params[:doctrine_id], current_page: search_params[:page] } }) end end