mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 06:52:33 -05:00
make public storage and direct upload optional
This commit is contained in:
1 parent
ff18fef2e3
commit
97b3adf91f
23 files changed
+336
-181
No files matched your search
@@ -7,7 +7,14 @@ module Api
|
||||
def create
|
||||
submitter = Submitter.find_by!(slug: params[:submitter_slug])
|
||||
|
||||
blob = ActiveStorage::Blob.find_signed(params[:blob_signed_id])
|
||||
blob =
|
||||
if (file = params[:file])
|
||||
ActiveStorage::Blob.create_and_upload!(io: file.open,
|
||||
filename: file.original_filename,
|
||||
content_type: file.content_type)
|
||||
else
|
||||
ActiveStorage::Blob.find_signed(params[:blob_signed_id])
|
||||
end
|
||||
|
||||
attachment = ActiveStorage::Attachment.create!(
|
||||
blob:,
|
||||
|
||||
Reference in new issue
Block a user