Add limit to search results
This commit is contained in:
parent
09218d4c01
commit
afded319d2
3 changed files with 12 additions and 14 deletions
|
@ -92,7 +92,8 @@ class Api::V1::AccountsController < ApiController
|
|||
end
|
||||
|
||||
def search
|
||||
@accounts = SearchService.new.call(params[:q], params[:resolve] == 'true')
|
||||
limit = params[:limit] ? [DEFAULT_ACCOUNTS_LIMIT, params[:limit].to_i].min : DEFAULT_ACCOUNTS_LIMIT
|
||||
@accounts = SearchService.new.call(params[:q], limit, params[:resolve] == 'true')
|
||||
render action: :index
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue