Files
docuseal/app/controllers/templates_restore_controller.rb
T

16 lines
382 B
Ruby
Raw Normal View History

2023-09-15 00:42:51 +03:00
# frozen_string_literal: true
class TemplatesRestoreController < ApplicationController
2023-09-17 00:45:57 +03:00
load_and_authorize_resource :template
2023-09-15 00:42:51 +03:00
2023-09-17 00:45:57 +03:00
def create
2026-06-24 19:08:15 +03:00
authorize!(:destroy, @template)
2026-05-15 18:55:03 +03:00
2023-12-30 00:37:03 +02:00
@template.update!(archived_at: nil)
2023-09-15 00:42:51 +03:00
2026-03-18 08:36:36 +02:00
WebhookUrls.enqueue_events(@template, 'template.updated')
2024-09-18 19:47:47 +03:00
redirect_to template_path(@template), notice: I18n.t('template_has_been_unarchived')
2023-09-15 00:42:51 +03:00
end
end