mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Improve renew action
This commit is contained in:
parent
dcb55a1af9
commit
349df32e95
2 changed files with 4 additions and 9 deletions
|
@ -40,7 +40,9 @@ module Repp
|
|||
@domain = Epp::Domain.find_by(registrar: registrar, name: params[:domain_id])
|
||||
@domain ||= Epp::Domain.find_by!(registrar: registrar, name_puny: params[:domain_id])
|
||||
|
||||
@domain
|
||||
return @domain if @domain
|
||||
|
||||
raise ActiveRecord::RecordNotFound
|
||||
end
|
||||
|
||||
def renew_params
|
||||
|
|
|
@ -15,19 +15,12 @@ module Actions
|
|||
end
|
||||
|
||||
def renew
|
||||
period = params[:period]
|
||||
unit = params[:period_unit]
|
||||
|
||||
task = Domains::BulkRenew::SingleDomainRenew.run(domain: domain,
|
||||
period: params[:period],
|
||||
unit: params[:period_unit],
|
||||
registrar: user)
|
||||
|
||||
return true if task
|
||||
|
||||
puts task.errors
|
||||
|
||||
false
|
||||
task.valid?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue