mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 13:15:40 +02:00
Add execution hook to controller
This commit is contained in:
parent
40b22cd433
commit
b0b5cea585
2 changed files with 8 additions and 1 deletions
|
@ -11,8 +11,10 @@ class Registrar
|
||||||
def bulk_renew
|
def bulk_renew
|
||||||
authorize! :manage, :repp
|
authorize! :manage, :repp
|
||||||
@expire_date = params[:expire_date].to_date
|
@expire_date = params[:expire_date].to_date
|
||||||
# binding.pry
|
|
||||||
@domains = domains_by_date(@expire_date)
|
@domains = domains_by_date(@expire_date)
|
||||||
|
if domain_ids_for_bulk_renew.present?
|
||||||
|
flash[:notice] = t(:bulk_renew_enqueued)
|
||||||
|
end
|
||||||
render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_renew }
|
render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_renew }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,5 +35,9 @@ class Registrar
|
||||||
def domains_by_date(date)
|
def domains_by_date(date)
|
||||||
domains_scope.where('valid_to <= ?', date)
|
domains_scope.where('valid_to <= ?', date)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def domain_ids_for_bulk_renew
|
||||||
|
params.dig('domain_ids').reject{ |id| id.blank? }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -662,3 +662,4 @@ en:
|
||||||
iban: IBAN
|
iban: IBAN
|
||||||
sign_in: "Sign in"
|
sign_in: "Sign in"
|
||||||
signed_in_successfully: "Signed in successfully"
|
signed_in_successfully: "Signed in successfully"
|
||||||
|
bulk_renew_enqueued: "Bulk renew for domains was enqueued"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue