mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 22:52:32 -05:00
add template download
This commit is contained in:
1 parent
9758f7a15f
commit
72dd2c6bc5
5 files changed
+127
-3
No files matched your search
@@ -3,6 +3,12 @@
|
||||
class TemplateDocumentsController < ApplicationController
|
||||
load_and_authorize_resource :template
|
||||
|
||||
FILES_TTL = 5.minutes
|
||||
|
||||
def index
|
||||
render json: @template.schema_documents.map { |d| ActiveStorage::Blob.proxy_url(d.blob, expires_at: FILES_TTL.from_now.to_i) }
|
||||
end
|
||||
|
||||
def create
|
||||
if params[:blobs].blank? && params[:files].blank?
|
||||
return render json: { error: I18n.t('file_is_missing') }, status: :unprocessable_content
|
||||
|
||||
Reference in new issue
Block a user