mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
Registrant API: Permit country_code param
This commit is contained in:
parent
34e71cc2c8
commit
40b7897e4b
2 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ module Api
|
||||||
obj.require(key)
|
obj.require(key)
|
||||||
end
|
end
|
||||||
|
|
||||||
params.permit(required_params)
|
params.permit(required_params + [:country_code])
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_token(user)
|
def create_token(user)
|
||||||
|
|
|
@ -76,7 +76,7 @@ class RegistrantUser < User
|
||||||
return false unless user_data[:last_name]
|
return false unless user_data[:last_name]
|
||||||
|
|
||||||
user_data[:country_code] ||= 'EE'
|
user_data[:country_code] ||= 'EE'
|
||||||
%i[ident country_code].each { |f| user_data[f].upcase! if user_data[f].is_a?(String) }
|
user_data[:country_code].upcase! if user_data[:country_code].is_a?(String)
|
||||||
|
|
||||||
find_or_create_by_user_data(user_data)
|
find_or_create_by_user_data(user_data)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue