Add balance checking

This commit is contained in:
Alex Sherman 2020-12-11 15:23:54 +05:00
parent 3ef6c53a8c
commit 729f39f612
5 changed files with 67 additions and 3 deletions

View file

@ -16,8 +16,12 @@ class Registrar
if domain_ids_for_bulk_renew.present?
domains = Epp::Domain.where(id: domain_ids_for_bulk_renew).to_a
task = Domains::BulkRenew::Start.run(domains: domains)
flash[:notice] = t(:bulk_renew_completed)
task = Domains::BulkRenew::Start.run(domains: domains, period_element: @period)
if task.valid?
flash[:notice] = t(:bulk_renew_completed)
else
flash[:notice] = task.errors.full_messages.join(' and ')
end
end
render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_renew }
end