adjust save dynamic

pull/555/merge
Pete Matsyburka 2 months ago
parent 8dc2ebfbe0
commit ed3c7c324b

@ -2735,10 +2735,13 @@ export default {
} else { } else {
this.isSaving = true this.isSaving = true
this.documentRefs.filter((ref) => ref.update).map((ref) => ref.update()) const dynamicDocumentRefs = this.documentRefs.filter((ref) => ref.isDynamic)
dynamicDocumentRefs.map((ref) => ref.update())
this.rebuildVariablesSchema({ disable: false }) this.rebuildVariablesSchema({ disable: false })
const dynamicDocumentSaves = this.documentRefs.filter((ref) => ref.saveBody).map((ref) => ref.saveBody()) const dynamicDocumentSaves = dynamicDocumentRefs.map((ref) => ref.saveBody())
Promise.all([this.save(), ...dynamicDocumentSaves]).then(() => { Promise.all([this.save(), ...dynamicDocumentSaves]).then(() => {
window.Turbo.visit(`/templates/${this.template.id}`) window.Turbo.visit(`/templates/${this.template.id}`)
@ -3028,6 +3031,8 @@ export default {
} else { } else {
dynamicDocumentRef.syncVariablesSchema(this.template.variables_schema, parsed, { disable }) dynamicDocumentRef.syncVariablesSchema(this.template.variables_schema, parsed, { disable })
} }
} else {
this.template.variables_schema = {}
} }
} }
} }

Loading…
Cancel
Save