From 5b10dd632eac3b13416fc8c0ae7ea5a01e0f02c8 Mon Sep 17 00:00:00 2001 From: Mirone Date: Fri, 17 May 2024 17:03:46 +0900 Subject: [PATCH] fix: missing type in job (#7087) --- packages/framework/store/src/transformer/job.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/framework/store/src/transformer/job.ts b/packages/framework/store/src/transformer/job.ts index fea7dc22bc10..39494745bf52 100644 --- a/packages/framework/store/src/transformer/job.ts +++ b/packages/framework/store/src/transformer/job.ts @@ -7,7 +7,7 @@ import type { Doc } from '../store/index.js'; import type { DocsPropertiesMeta } from '../store/meta.js'; import { AssetsManager } from './assets.js'; import { BaseBlockTransformer } from './base.js'; -import { type DraftModel } from './draft.js'; +import { type DraftModel, toDraftModel } from './draft.js'; import type { BeforeExportPayload, BeforeImportPayload, @@ -386,14 +386,14 @@ export class Job { SliceSnapshotSchema.parse(snapshot); const { content, pageVersion, workspaceVersion, workspaceId, pageId } = snapshot; - const contentBlocks = []; + const contentBlocks: BlockModel[] = []; for (const [i, block] of content.entries()) { contentBlocks.push( await this._snapshotToBlock(block, doc, parent, (index ?? 0) + i) ); } const slice = new Slice({ - content: contentBlocks, + content: contentBlocks.map(block => toDraftModel(block)), pageVersion, workspaceVersion, workspaceId,