1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 21:29:38 +02:00

Only pass in a country code on securities searches if the user location is set to "US"

This commit is contained in:
Josh Pigford 2025-01-23 10:02:48 -06:00
parent 68c570eed8
commit 44961f3628

View file

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