mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
optimize document upload
This commit is contained in:
1 parent
8b823ca0d0
commit
2cb15f3282
4 files changed
+87
-35
No files matched your search
@@ -6,6 +6,8 @@ class TemplateDocumentsController < ApplicationController
|
||||
def create
|
||||
return head :unprocessable_entity if params[:blobs].blank? && params[:files].blank?
|
||||
|
||||
old_fields_hash = @template.fields.hash
|
||||
|
||||
documents = Templates::CreateAttachments.call(@template, params)
|
||||
|
||||
schema = documents.map do |doc|
|
||||
@@ -14,6 +16,8 @@ class TemplateDocumentsController < ApplicationController
|
||||
|
||||
render json: {
|
||||
schema:,
|
||||
fields: old_fields_hash == @template.fields.hash ? nil : @template.fields,
|
||||
submitters: old_fields_hash == @template.fields.hash ? nil : @template.submitters,
|
||||
documents: documents.as_json(
|
||||
methods: %i[metadata signed_uuid],
|
||||
include: {
|
||||
|
||||
Reference in new issue
Block a user