Browse Source

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.
closed-social-glitch-2
Lady Lumb 5 years ago
committed by ThibG
parent
commit
0ed0c77266
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/controllers/api/v1/search_controller.rb

+ 1
- 1
app/controllers/api/v1/search_controller.rb View File

@ -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