v0.16-1 二次修复: report/save+publish validateReportCreate 错误处理 (2026-07-02)

validateReportCreate 返回 {ok, steps: StepValidation[]}, 不是 {ok, errors}
跟之前 v0.15-1 print/update 一样的 bug, 修复遍历 steps 收集错误
This commit is contained in:
ssw committed 2026-07-02 13:52:20 +08:00
1 parent 1650c3fe57
commit b5eb4bc3ac
2 files changed
+8 -4

No files matched your search

+4 -2
View File
@@ -60,14 +60,16 @@ export function buildReportPublishCommand(): Command {
process.exit(1)
}
// step machine 校验
// step machine 校验 (validateReportCreate 返 {ok, steps: StepValidation[]})
const vBasic = validateReportCreate({
fullName: current.fullName as string,
enCode: current.enCode as string,
category: current.category as string,
})
if (!vBasic.ok) {
for (const err of vBasic.errors) log.error(` [${vBasic.stepName}] ${err.message}`)
for (const step of vBasic.steps) {
for (const err of step.errors) log.error(` [${step.stepName}] ${err.message}`)
}
process.exit(1)
}
+4 -2
View File
@@ -58,14 +58,16 @@ export function buildReportSaveCommand(): Command {
process.exit(1)
}
// step machine 校验
// step machine 校验 (validateReportCreate 返 {ok, steps: StepValidation[]})
const vBasic = validateReportCreate({
fullName: current.fullName as string,
enCode: current.enCode as string,
category: current.category as string,
})
if (!vBasic.ok) {
for (const err of vBasic.errors) log.error(` [${vBasic.stepName}] ${err.message}`)
for (const step of vBasic.steps) {
for (const err of step.errors) log.error(` [${step.stepName}] ${err.message}`)
}
process.exit(1)
}