diff --git a/app/controllers/api/v0/themes_controller.rb b/app/controllers/api/v0/themes_controller.rb index e07dc9d..ba48b82 100644 --- a/app/controllers/api/v0/themes_controller.rb +++ b/app/controllers/api/v0/themes_controller.rb @@ -26,8 +26,15 @@ if params[:question_id].present? && params[:question_id] @answers = @answers.where(question_id: params[:question_id]) end - - @answers += admin_answers + org_answers + + if params[:start_date].present? && params[:start_date] + @answers = @answers.where('answers.created_at >=?', params[:start_date]) + end + + if params[:end_date].present? && params[:end_date] + @answers = @answers.where('answers.created_at <=?', params[:end_date]) + end + end def extract_params