Skip to content

Commit

Permalink
Merge pull request #2421 from internetee/address-processing-for-conta…
Browse files Browse the repository at this point in the history
…ct-form

Fixed contact creation form for new registrar portal
  • Loading branch information
vohmar authored Aug 25, 2022
2 parents dc42d79 + 442fa87 commit 497aa2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/repp/v1/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def auth_values_to_data(registrar:)
data = current_user.as_json(only: %i[id username roles])
data[:registrar_name] = registrar.name
data[:legaldoc_mandatory] = registrar.legaldoc_mandatory?
data[:address_processing] = Contact.address_processing?
data[:abilities] = Ability.new(current_user).permissions
data
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/repp/v1/contacts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def contact_params_with_address(required: true)
def contact_create_params(required: true)
create_params = %i[name email phone]
contact_params.require(create_params) if required
contact_params.slice(*create_params)
contact_params.slice(:id, *create_params)
end

def contact_ident_params(required: true)
Expand All @@ -211,7 +211,7 @@ def contact_addr_params
end

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],
ident: [%i[ident ident_type ident_country_code]],
addr: [%i[country_code city street zip state]])
Expand Down

0 comments on commit 497aa2a

Please sign in to comment.