Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: simplify remove from all notebooks logic

Abdullah Attadba1d8645d2f
diff --git a/packages/core/src/collections/notes.ts b/packages/core/src/collections/notes.ts
index 17300f5de..ea9b61db0 100644
--- a/packages/core/src/collections/notes.ts
+++ b/packages/core/src/collections/notes.ts
@@ -387,13 +387,9 @@ export class Notes implements ICollection {
}
async removeFromAllNotebooks(...noteIds: string[]) {
- await this.db.transaction(async () => {
- for (const noteId of noteIds) {
- await this.db.relations
- .to({ type: "note", id: noteId }, "notebook")
- .unlink();
- }
- });
+ await this.db.relations
+ .to({ type: "note", ids: noteIds }, "notebook")
+ .unlink();
}
async contentBlocks(id: string) {