mirror of
https://github.com/docusealco/docuseal
synced 2026-11-07 15:22:33 -05:00
generate pdfs from images
This commit is contained in:
1 parent
1da67011c4
commit
92e05ae8e9
5 files changed
+127
-43
No files matched your search
@@ -8,6 +8,15 @@ class SubmissionsDownloadController < ApplicationController
|
||||
|
||||
Submissions::GenerateResultAttachments.call(submitter) if submitter.documents.blank?
|
||||
|
||||
render json: submitter.documents.map { |e| helpers.rails_blob_url(e) }
|
||||
original_documents = submitter.submission.template.documents.preload(:blob)
|
||||
is_more_than_two_images = original_documents.count(&:image?) > 1
|
||||
|
||||
urls = submitter.documents.preload(:blob).filter_map do |attachment|
|
||||
next if is_more_than_two_images && original_documents.find { |a| a.uuid == attachment.uuid }&.image?
|
||||
|
||||
helpers.rails_blob_url(attachment)
|
||||
end
|
||||
|
||||
render json: urls
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user