mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-17 06:16:59 +08:00
refactor(editor): job should not rely on doc collection directly (#9488)
This commit is contained in:
@@ -27,5 +27,14 @@ export function createJob(middlewares?: JobMiddleware[]) {
|
||||
const schema = new Schema().register(AffineSchemas);
|
||||
const docCollection = new DocCollection({ schema });
|
||||
docCollection.meta.initialize();
|
||||
return new Job({ collection: docCollection, middlewares: testMiddlewares });
|
||||
return new Job({
|
||||
schema,
|
||||
blobCRUD: docCollection.blobSync,
|
||||
middlewares: testMiddlewares,
|
||||
docCRUD: {
|
||||
create: (id: string) => docCollection.createDoc({ id }),
|
||||
get: (id: string) => docCollection.getDoc(id),
|
||||
delete: (id: string) => docCollection.removeDoc(id),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user