Move interactor from Interactor gem to ActiveInteraction

This commit is contained in:
Alex Sherman 2020-11-11 15:44:00 +05:00
parent 3c7fa88463
commit bce39e3404
17 changed files with 70 additions and 65 deletions

View file

@ -4,11 +4,15 @@ module Admin
def create
authorize! :manage, domain
notice = t('.scheduled')
domain.transaction do
domain.schedule_force_delete(type: force_delete_type, notify_by_email: notify_by_email?)
result = domain.schedule_force_delete(type: force_delete_type,
notify_by_email: notify_by_email?)
notice = result.errors.messages[:domain].first unless result.valid?
end
redirect_to edit_admin_domain_url(domain), notice: t('.scheduled')
redirect_to edit_admin_domain_url(domain), notice: notice
end
def destroy