Class: Yes::Read::Api::QueriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/yes/read/api/queries_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#append_info_to_payload, #set_locale

Instance Method Details

#advancedObject



27
28
29
# File 'app/controllers/yes/read/api/queries_controller.rb', line 27

def advanced
  render json: response_json(filter_type: :advanced).to_json
end

#callObject



21
22
23
24
25
# File 'app/controllers/yes/read/api/queries_controller.rb', line 21

def call
  persisted_filter = filter(read_model_name).persisted_filter_scope.find_by(id: params[:filter_id]) if params[:filter_id].present?

  render json: response_json(persisted_filter:, filter_type: persisted_filter ? :advanced : :basic).to_json
end