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.
signup-info-prompt
Lady Lumb 2019-05-31 01:48:11 -07:00 committed by ThibG
parent 249b7c7c12
commit 0ed0c77266
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@
class Api::V1::SearchController < Api::BaseController class Api::V1::SearchController < Api::BaseController
include Authorization include Authorization
RESULTS_LIMIT = 20 RESULTS_LIMIT = (ENV['MAX_SEARCH_RESULTS'] || 20).to_i
before_action -> { doorkeeper_authorize! :read, :'read:search' } before_action -> { doorkeeper_authorize! :read, :'read:search' }
before_action :require_user! before_action :require_user!