mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Only pass in a country code on securities searches if the user location is set to "US"
This commit is contained in:
@@ -5,14 +5,7 @@ class SecuritiesController < ApplicationController
|
||||
|
||||
@securities = Security.search({
|
||||
search: query,
|
||||
country: country_code_filter
|
||||
country: params[:country_code] == "US" ? "US" : nil
|
||||
})
|
||||
end
|
||||
|
||||
private
|
||||
def country_code_filter
|
||||
filter = params[:country_code]
|
||||
filter = "#{filter},US" unless filter == "US"
|
||||
filter
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user