fix: if delete block, clear cache

This commit is contained in:
alt0
2022-08-18 14:29:44 +08:00
parent 5959c08873
commit 68cadca5ca
@@ -230,7 +230,12 @@ export class Editor implements Virgo {
return await services.api.editorBlock.update(patches); return await services.api.editorBlock.update(patches);
}, },
remove: async ({ workspace, id }: WorkspaceAndBlockId) => { remove: async ({ workspace, id }: WorkspaceAndBlockId) => {
return await services.api.editorBlock.delete({ workspace, id }); const ret = await services.api.editorBlock.delete({
workspace,
id,
});
this._cacheManager.delete(id);
return ret;
}, },
observe: async ( observe: async (
{ workspace, id }: WorkspaceAndBlockId, { workspace, id }: WorkspaceAndBlockId,