mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Create domain renew action
This commit is contained in:
parent
454433cf10
commit
dcb55a1af9
2 changed files with 36 additions and 2 deletions
|
@ -9,11 +9,12 @@ module Repp
|
|||
api :POST, 'repp/v1/domains/:domain_name/renew'
|
||||
desc 'Renew domain'
|
||||
param :renew, Hash, required: true, desc: 'Renew parameters' do
|
||||
param :renew_period, Integer, required: true, desc: 'Renew period. Month (m) or year (y)'
|
||||
param :period, Integer, required: true, desc: 'Renew period. Month (m) or year (y)'
|
||||
param :period_unit, String, required: true, desc: 'For how many months or years to renew'
|
||||
end
|
||||
def create
|
||||
action = Actions::DomainUpdate.new(@domain, renew_params[:renew], current_user)
|
||||
authorize!(:renew, @domain)
|
||||
action = Actions::DomainRenew.new(@domain, renew_params[:renew], current_user.registrar)
|
||||
|
||||
unless action.call
|
||||
handle_errors(@domain)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue