mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 17:55:55 +02:00
Add experimental registrant change accept/deny API endpoint
This commit is contained in:
parent
09389ea662
commit
377a95cc76
2 changed files with 14 additions and 0 deletions
|
@ -17,10 +17,23 @@ module Api
|
|||
end
|
||||
|
||||
def update
|
||||
verification = RegistrantVerification.new(domain_id: @domain.id,
|
||||
verification_token: confirmation_params[:token])
|
||||
|
||||
head(update_action(verification) ? :ok : :bad_request)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def update_action(verification)
|
||||
initiator = "email link, #{t(:user_not_authenticated)}"
|
||||
if params[:confirm].present?
|
||||
verification.domain_registrant_change_confirm!(initiator)
|
||||
else
|
||||
verification.domain_registrant_change_reject!(initiator)
|
||||
end
|
||||
end
|
||||
|
||||
def serialized_registrant(registrant)
|
||||
{
|
||||
name: registrant.try(:name),
|
||||
|
|
|
@ -5,6 +5,7 @@ class RegistrantChange
|
|||
end
|
||||
|
||||
def confirm
|
||||
Dispute.close_by_domain(@domain.name) if @domain.disputed?
|
||||
notify_registrant
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue