mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-20 13:49:39 +02:00
Only pass in a country code on securities searches if the user location is set to "US"
This commit is contained in:
parent
68c570eed8
commit
44961f3628
1 changed files with 1 additions and 8 deletions
|
@ -5,14 +5,7 @@ class SecuritiesController < ApplicationController
|
||||||
|
|
||||||
@securities = Security.search({
|
@securities = Security.search({
|
||||||
search: query,
|
search: query,
|
||||||
country: country_code_filter
|
country: params[:country_code] == "US" ? "US" : nil
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
def country_code_filter
|
|
||||||
filter = params[:country_code]
|
|
||||||
filter = "#{filter},US" unless filter == "US"
|
|
||||||
filter
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue