core: simplify remove from all notebooks logic

This commit is contained in:
Abdullah Atta
2024-03-14 09:57:02 +05:00
parent 9dff23bdd5
commit dba1d8645d

View File

@@ -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) {