mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 06:52:33 -05:00
fix updated templates
This commit is contained in:
1 parent
d4aef79b68
commit
6a298a068c
1 file changed
+7
-1
@@ -25,9 +25,15 @@ module Templates
|
||||
name: :preview_images)
|
||||
.preload(:blob)
|
||||
|
||||
json[:documents] = template.schema.map do |item|
|
||||
json[:documents] = template.schema.filter_map do |item|
|
||||
attachment = schema_documents.find { |e| e.uuid == item['attachment_uuid'] }
|
||||
|
||||
unless attachment
|
||||
Rollbar.error("Documents missing: #{template.id}") if defined?(Rollbar)
|
||||
|
||||
next
|
||||
end
|
||||
|
||||
first_page_blob = preview_image_attachments.find { |e| e.record_id == attachment.id }&.blob
|
||||
first_page_blob ||= attachment.preview_images.joins(:blob).find_by(blob: { filename: ['0.jpg', '0.png'] })&.blob
|
||||
|
||||
|
||||
Reference in new issue
Block a user