mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +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
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
verification = RegistrantVerification.new(domain_id: @domain.id,
|
||||||
|
verification_token: confirmation_params[:token])
|
||||||
|
|
||||||
|
head(update_action(verification) ? :ok : :bad_request)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
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)
|
def serialized_registrant(registrant)
|
||||||
{
|
{
|
||||||
name: registrant.try(:name),
|
name: registrant.try(:name),
|
||||||
|
|
|
@ -5,6 +5,7 @@ class RegistrantChange
|
||||||
end
|
end
|
||||||
|
|
||||||
def confirm
|
def confirm
|
||||||
|
Dispute.close_by_domain(@domain.name) if @domain.disputed?
|
||||||
notify_registrant
|
notify_registrant
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue