mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 05:29:08 +08:00
refactor(editor): job should not rely on doc collection directly (#9488)
This commit is contained in:
@@ -6,8 +6,14 @@ export async function importFromSnapshot(
|
||||
snapshot: DocSnapshot
|
||||
) {
|
||||
const job = new Job({
|
||||
collection,
|
||||
middlewares: [replaceIdMiddleware],
|
||||
schema: collection.schema,
|
||||
blobCRUD: collection.blobSync,
|
||||
docCRUD: {
|
||||
create: (id: string) => collection.createDoc({ id }),
|
||||
get: (id: string) => collection.getDoc(id),
|
||||
delete: (id: string) => collection.removeDoc(id),
|
||||
},
|
||||
middlewares: [replaceIdMiddleware(collection.idGenerator)],
|
||||
});
|
||||
|
||||
return job.snapshotToDoc(snapshot);
|
||||
|
||||
Reference in New Issue
Block a user