From ccc06fcc3df0ce01cdeffedce71f21180b26bb43 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Wed, 17 Jan 2024 00:24:21 +0200 Subject: [PATCH] allow to remove template permanently --- app/controllers/api/templates_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/templates_controller.rb b/app/controllers/api/templates_controller.rb index 5c9d6561..3a83ad42 100644 --- a/app/controllers/api/templates_controller.rb +++ b/app/controllers/api/templates_controller.rb @@ -38,7 +38,11 @@ module Api end def destroy - @template.update!(archived_at: Time.current) + if params[:permanently] == 'true' && !Docuseal.multitenant? + @template.destroy! + else + @template.update!(archived_at: Time.current) + end render json: @template.as_json(only: %i[id archived_at]) end