add folder name to submission resp

This commit is contained in:
Pete Matsyburka
2024-04-11 16:36:53 +03:00
parent 6f5ebfc8a6
commit 33c0784bc6
3 changed files with 7 additions and 5 deletions
+1 -3
View File
@@ -6,12 +6,10 @@ module Templates
def call(template, schema_documents = template.schema_documents, preview_image_attachments = [])
json = template.as_json(
methods: %i[application_key],
methods: %i[application_key folder_name],
include: { author: { only: %i[id email first_name last_name] } }
)
json[:folder_name] = template.folder.name
json[:documents] = template.schema.map do |item|
attachment = schema_documents.find { |e| e.uuid == item['attachment_uuid'] }