app/controllers/search_notes_controller.rb
# Assumes always sorting by descending time from a particular moment, limited
# to what the caller asks for
Assumes always sorting by descending time from a particular moment, limited
to what the caller asks for
Assumes always sorting by descending time from a particular moment limited to what the caller asks for
def query_json
    query = query_from_safe_params(params.permit(*[
      :start_time,
      :end_time,
      :limit,
      :scope_key,
      :text,
      :grade,
      :house,
      :event_note_type_id
    ]))
    results = SearchNotesQueries.new(current_educator).query(query)
    event_note_cards_json, all_results_size, query_with_defaults = results
    render json: {
      query: query_with_defaults,
      event_note_cards: event_note_cards_json,
      meta: {
        returned_size: event_note_cards_json.size,
        all_results_size: all_results_size
      }
    }
  end
def query_json query = query_from_safe_params ( params . permit ( * [ :start_time , :end_time , :limit , :scope_key , :text , :grade , :house , :event_note_type_id ] ) ) results = SearchNotesQueries . new ( current_educator ) . query ( query ) event_note_cards_json , all_results_size , query_with_defaults = results render json : { query : query_with_defaults , event_note_cards : event_note_cards_json , meta : { returned_size : event_note_cards_json . size , all_results_size : all_results_size } } end
Assumes always sorting by descending time from a particular moment, limited
to what the caller asks for
Assumes always sorting by descending time from a particular moment limited to what the caller asks for