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.
master
Lady Lumb 6 years ago committed by ThibG
parent 249b7c7c12
commit 0ed0c77266
  1. 2
      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!

Loading…
Cancel
Save