v0.15-1 二次修复: print/update validatePrintCreate 错误处理 (2026-07-02)

validatePrintCreate 返回 {ok, steps: StepValidation[]}, 不是 {ok, errors}
修复: 遍历 steps 收集所有错误 (跟 form/workflow update 一致)
This commit is contained in:
ssw committed 2026-07-02 13:46:57 +08:00
1 parent a9e42aa447
commit 8e7be85720
1 file changed
+4 -1
+4 -1
View File
@@ -96,7 +96,10 @@ export function buildPrintUpdateCommand(): Command {
if (Object.keys(toValidate).length > 0) {
const v = validatePrintCreate(toValidate as Parameters<typeof validatePrintCreate>[0])
if (!v.ok) {
for (const err of v.errors) log.error(` ${err.message}`)
// 遍历所有 step 收集错误
for (const step of v.steps) {
for (const err of step.errors) log.error(` [${step.stepName}] ${err.message}`)
}
process.exit(1)
}
}