preload dynamic editor

pull/555/merge
Pete Matsyburka 1 week ago
parent e90ac391b2
commit f5ae8c60d3

@ -274,13 +274,16 @@ export default {
makeDynamic () { makeDynamic () {
this.isMakeDynamicLoading = true this.isMakeDynamicLoading = true
Promise.all([
this.baseFetch(`/templates/${this.template.id}/dynamic_documents`, { this.baseFetch(`/templates/${this.template.id}/dynamic_documents`, {
method: 'POST', method: 'POST',
body: JSON.stringify({ uuid: this.document.uuid }), body: JSON.stringify({ uuid: this.document.uuid }),
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
} }
}).then(async (resp) => { }),
import(/* webpackChunkName: "dynamic-editor" */ './dynamic_document')
]).then(async ([resp, _]) => {
const dynamicDocument = await resp.json() const dynamicDocument = await resp.json()
this.template.schema.find((item) => item.attachment_uuid === dynamicDocument.uuid).dynamic = true this.template.schema.find((item) => item.attachment_uuid === dynamicDocument.uuid).dynamic = true

Loading…
Cancel
Save