mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 21:16:12 +02:00
Return address processing setting and add id paramater when creating new contact
This commit is contained in:
parent
a5f803b57a
commit
442fa879d2
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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]])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue