about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorLady Lumb <42786600+LadyLumb@users.noreply.github.com>2019-05-31 01:48:11 -0700
committerThibG <thib@sitedethib.com>2019-07-20 16:39:48 +0200
commit0ed0c77266b82f313dec196d82edcc0aef5c2ae5 (patch)
tree0d050f529fa861b4f57dfb16cb9cd476087ec24d /app/controllers
parent249b7c7c1298d2ac4da68a5806043d6424cf3ac0 (diff)
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.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api/v1/search_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/api/v1/search_controller.rb b/app/controllers/api/v1/search_controller.rb
index 6131cbbb6..4fb869bb9 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!