This commit is contained in:
2026-08-14 16:06:33 +08:00
parent 09e44e6520
commit 610cc1abf9
17 changed files with 135 additions and 41 deletions
@@ -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' })