From 442fa879d2951e5d3aa87c7c7a10f0769c1b742a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergei=20Ts=C3=B5ganov?= Date: Fri, 19 Aug 2022 10:49:51 +0300 Subject: [PATCH] Return address processing setting and add id paramater when creating new contact --- app/controllers/repp/v1/base_controller.rb | 1 + app/controllers/repp/v1/contacts_controller.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/repp/v1/base_controller.rb b/app/controllers/repp/v1/base_controller.rb index 10c3c6026..d84c8e37b 100644 --- a/app/controllers/repp/v1/base_controller.rb +++ b/app/controllers/repp/v1/base_controller.rb @@ -163,6 +163,7 @@ module Repp 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 diff --git a/app/controllers/repp/v1/contacts_controller.rb b/app/controllers/repp/v1/contacts_controller.rb index 31be5e09b..6f5e79a64 100644 --- a/app/controllers/repp/v1/contacts_controller.rb +++ b/app/controllers/repp/v1/contacts_controller.rb @@ -193,7 +193,7 @@ module Repp 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) @@ -211,7 +211,7 @@ module Repp 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]])