From c81369aeb0161f5b30be78810ef7fd823979e192 Mon Sep 17 00:00:00 2001 From: Lady Lumb <42786600+LadyLumb@users.noreply.github.com> Date: Fri, 31 May 2019 01:48:11 -0700 Subject: [PATCH] Add env variable to control search limit Changed the default search limit to allow a variable called MAX_SEARCH_RESULTS in the .env.production file to change the maximum search results limit. --- app/controllers/api/v1/search_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/search_controller.rb b/app/controllers/api/v1/search_controller.rb index 6131cbbb69..4fb869bb91 100644 --- a/app/controllers/api/v1/search_controller.rb +++ b/app/controllers/api/v1/search_controller.rb @@ -3,7 +3,7 @@ class Api::V1::SearchController < Api::BaseController include Authorization - RESULTS_LIMIT = 20 + RESULTS_LIMIT = (ENV['MAX_SEARCH_RESULTS'] || 20).to_i before_action -> { doorkeeper_authorize! :read, :'read:search' } before_action :require_user!