mirror of
https://github.com/internetee/registry.git
synced 2025-08-22 17:20:49 +02:00
Updated REPP API for new registrar portal
This commit is contained in:
parent
e17b21436d
commit
a5ffce290d
61 changed files with 1269 additions and 408 deletions
|
@ -2,19 +2,16 @@ module Repp
|
|||
module V1
|
||||
module Domains
|
||||
class BaseContactsController < BaseController
|
||||
before_action :set_current_contact, only: [:update]
|
||||
before_action :set_new_contact, only: [:update]
|
||||
before_action :set_contacts, only: [:update]
|
||||
|
||||
def set_current_contact
|
||||
@current_contact = current_user.registrar.contacts
|
||||
.find_by!(code: contact_params[:current_contact_id])
|
||||
end
|
||||
|
||||
def set_new_contact
|
||||
@new_contact = current_user.registrar.contacts.find_by!(code: params[:new_contact_id])
|
||||
def set_contacts
|
||||
contacts = current_user.registrar.contacts
|
||||
@current_contact = contacts.find_by!(code: contact_params[:current_contact_id])
|
||||
@new_contact = contacts.find_by!(code: contact_params[:new_contact_id])
|
||||
end
|
||||
|
||||
def update
|
||||
authorize! :manage, :repp
|
||||
@epp_errors ||= ActiveModel::Errors.new(self)
|
||||
return unless @new_contact.invalid?
|
||||
|
||||
|
@ -26,8 +23,11 @@ module Repp
|
|||
private
|
||||
|
||||
def contact_params
|
||||
params.require(%i[current_contact_id new_contact_id])
|
||||
params.permit(:current_contact_id, :new_contact_id)
|
||||
param_list = %i[current_contact_id new_contact_id]
|
||||
params.require(param_list)
|
||||
params.permit(:current_contact_id, :new_contact_id,
|
||||
contact: {},
|
||||
admin_contact: [param_list])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue