detect fields autosave false

This commit is contained in:
Pete Matsyburka committed 2026-09-02 20:08:42 +03:00
1 parent 033ce3a169
commit 436d947f6a
2 files changed
+16 -7

No files matched your search

+8 -5
View File
@@ -555,8 +555,10 @@ export default {
return this.template.schema.some((item) => item.dynamic)
},
numberOfPages () {
return this.template.documents.reduce((acc, doc) => {
return acc + doc.metadata?.pdf?.number_of_pages || doc.preview_images.length
return this.template.schema.reduce((acc, item) => {
const doc = this.template.documents.find((d) => d.uuid === item.attachment_uuid)
return acc + (doc?.metadata?.pdf?.number_of_pages || doc?.preview_images?.length || 0)
}, 0)
},
isShowFieldSearch () {
@@ -774,9 +776,10 @@ export default {
headers: {
'Content-Type': 'application/json'
},
...(this.withDetectExistingFields
? { body: JSON.stringify({ fields: this.buildExistingFields() }) }
: {})
body: JSON.stringify({
attachment_uuid: this.template.schema.map((item) => item.attachment_uuid),
...(this.withDetectExistingFields ? { fields: this.buildExistingFields() } : {})
})
}).then(async (response) => {
const reader = response.body.getReader()
const decoder = new TextDecoder('utf-8')