allow to permanently delete submissions
This commit is contained in:
@@ -89,11 +89,15 @@ module Api
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@submission.update!(archived_at: Time.current)
|
if params[:permanently] == 'true'
|
||||||
|
@submission.destroy!
|
||||||
|
else
|
||||||
|
@submission.update!(archived_at: Time.current)
|
||||||
|
|
||||||
SendSubmissionArchivedWebhookRequestJob.perform_later(@submission)
|
SendSubmissionArchivedWebhookRequestJob.perform_later(@submission)
|
||||||
|
end
|
||||||
|
|
||||||
render json: @submission.as_json(only: %i[id], methods: %i[archived_at])
|
render json: @submission.as_json(only: %i[id archived_at])
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ module Api
|
|||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
if params[:permanently] == 'true' && !Docuseal.multitenant?
|
if params[:permanently] == 'true'
|
||||||
@template.destroy!
|
@template.destroy!
|
||||||
else
|
else
|
||||||
@template.update!(archived_at: Time.current)
|
@template.update!(archived_at: Time.current)
|
||||||
|
|||||||
Reference in New Issue
Block a user