From dba1d8645d2fc91f77295ccc73f1108e1e2219b1 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Thu, 14 Mar 2024 09:57:02 +0500 Subject: [PATCH] core: simplify remove from all notebooks logic --- packages/core/src/collections/notes.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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) {