Revamp WHOIS for auctions

Fixes #1105
This commit is contained in:
Artur Beljajev 2019-03-17 19:24:44 +02:00
parent 5d61cbf4a8
commit daba47790c
9 changed files with 125 additions and 125 deletions

View file

@ -30,6 +30,12 @@ module Api
raise "Invalid status #{params[:status]}"
end
if auction.payment_not_received? || auction.domain_not_registered?
update_whois_from_auction(Auction.pending(auction.domain))
else
update_whois_from_auction(auction)
end
render json: serializable_hash_for_update_action(auction)
end
@ -44,6 +50,11 @@ module Api
hash[:registration_code] = auction.registration_code if auction.payment_received?
hash
end
def update_whois_from_auction(auction)
whois_record = Whois::Record.find_by!(name: auction.domain)
whois_record.update_from_auction(auction)
end
end
end
end