fix: 兼容新工作流空历史快照响应
Piper 无快照时可能返回 items 为 null,在传输层归一化为空数组。 保留分页及其他校验,覆盖正常条目、无效集合和业务错误,补充说明。 验证:945 项测试、类型和版本检查通过,README 审计通过。
This commit is contained in:
1 parent
a2cdefb322
commit
306eaa9fa9
3 files changed
+25
-2
No files matched your search
@@ -195,7 +195,10 @@ export async function listWorkflowSnapshots(
|
||||
const response = await client.get(`api/easo/pipelines/${pipelineId}/snapshots`, {
|
||||
searchParams: { number: String(page), pageSize: String(pageSize) },
|
||||
});
|
||||
return unwrap(response, WorkflowSnapshotPageSchema);
|
||||
// 新工作流没有历史快照时,Piper 将 items 返回为 null;仅归一化空集合,保留其他校验。
|
||||
return unwrap(response, WorkflowSnapshotPageSchema.extend({
|
||||
items: WorkflowSnapshotPageSchema.shape.items.nullable().transform(items => items ?? []),
|
||||
}));
|
||||
}
|
||||
|
||||
export async function getWorkflowSnapshot(
|
||||
|
||||
Reference in new issue
Block a user