allow to permanently remove templates

This commit is contained in:
DocuSeal
2023-10-29 18:51:58 +02:00
parent 8c366dfc38
commit 607fc8d338
2 changed files with 14 additions and 5 deletions
+11 -2
View File
@@ -57,9 +57,18 @@ class TemplatesController < ApplicationController
end
def destroy
@template.update!(deleted_at: Time.current)
notice =
if !Docuseal.multitenant? && params[:permanently].present?
@template.destroy!
redirect_back(fallback_location: root_path, notice: 'Template has been archived.')
'Template has been removed.'
else
@template.update!(deleted_at: Time.current)
'Template has been archived.'
end
redirect_back(fallback_location: root_path, notice:)
end
private