优化
This commit is contained in:
@@ -475,7 +475,8 @@ test('copies reactive order drafts into plain request data', () => {
|
||||
assert.match(source, /function cloneDraft\(draft: FirstLegOrderDraft\)/)
|
||||
assert.match(source, /items: draft\.items\.map\(\(item\) => \(\{ \.\.\.item \}\)\)/)
|
||||
assert.match(source, /store\.saveDraft\(cloneDraft\(form\)/)
|
||||
assert.match(source, /store\.submit\(cloneDraft\(form\)/)
|
||||
assert.match(source, /editingId\.value = savedOrder\.id/)
|
||||
assert.match(source, /store\.submitSaved\(savedOrder\.id/)
|
||||
assert.doesNotMatch(source, /structuredClone\((?:form|order\.)/)
|
||||
})
|
||||
|
||||
|
||||
@@ -1425,7 +1425,9 @@ async function submitOrder() {
|
||||
try {
|
||||
saving.value = true
|
||||
const knownCompanyAuditStatus = companyAuditLoaded.value ? tenantStore.company.auditStatus : undefined
|
||||
const order = await store.submit(cloneDraft(form), tenantStore.company.companyName, editingId.value, knownCompanyAuditStatus)
|
||||
const savedOrder = await store.saveDraft(cloneDraft(form), tenantStore.company.companyName, editingId.value)
|
||||
editingId.value = savedOrder.id
|
||||
const order = await store.submitSaved(savedOrder.id, knownCompanyAuditStatus)
|
||||
markEditorClean()
|
||||
editorOpen.value = false
|
||||
if (isCreatePage.value) await router.push({ name: 'first-leg-orders' })
|
||||
|
||||
Reference in New Issue
Block a user