The code powering m.abunchtell.com https://m.abunchtell.com
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

28 lignes
471 B

  1. # frozen_string_literal: true
  2. class Api::V1::SearchController < Api::BaseController
  3. RESULTS_LIMIT = 5
  4. respond_to :json
  5. def index
  6. @search = Search.new(search_results)
  7. render json: @search, serializer: REST::SearchSerializer
  8. end
  9. private
  10. def search_results
  11. SearchService.new.call(
  12. params[:q],
  13. RESULTS_LIMIT,
  14. resolving_search?,
  15. current_account
  16. )
  17. end
  18. def resolving_search?
  19. params[:resolve] == 'true'
  20. end
  21. end