Merge pull request #2421 from internetee/address-processing-for-contact-form

Fixed contact creation form for new registrar portal
This commit is contained in:
Timo Võhmar 2022-08-25 17:33:43 +03:00 committed by GitHub
commit 497aa2adfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -163,6 +163,7 @@ module Repp
data = current_user.as_json(only: %i[id username roles]) data = current_user.as_json(only: %i[id username roles])
data[:registrar_name] = registrar.name data[:registrar_name] = registrar.name
data[:legaldoc_mandatory] = registrar.legaldoc_mandatory? data[:legaldoc_mandatory] = registrar.legaldoc_mandatory?
data[:address_processing] = Contact.address_processing?
data[:abilities] = Ability.new(current_user).permissions data[:abilities] = Ability.new(current_user).permissions
data data
end end

View file

@ -193,7 +193,7 @@ module Repp
def contact_create_params(required: true) def contact_create_params(required: true)
create_params = %i[name email phone] create_params = %i[name email phone]
contact_params.require(create_params) if required contact_params.require(create_params) if required
contact_params.slice(*create_params) contact_params.slice(:id, *create_params)
end end
def contact_ident_params(required: true) def contact_ident_params(required: true)
@ -211,7 +211,7 @@ module Repp
end end
def contact_params def contact_params
params.require(:contact).permit(:name, :email, :phone, :legal_document, params.require(:contact).permit(:id, :name, :email, :phone, :legal_document,
legal_document: %i[body type], legal_document: %i[body type],
ident: [%i[ident ident_type ident_country_code]], ident: [%i[ident ident_type ident_country_code]],
addr: [%i[country_code city street zip state]]) addr: [%i[country_code city street zip state]])