Skip to content

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

web: simplify removing note from topic

Abdullah Attac4b6ab40d864
diff --git a/apps/web/src/components/note/index.js b/apps/web/src/components/note/index.js
index dd3bd522c..7a3e63010 100644
--- a/apps/web/src/components/note/index.js
+++ b/apps/web/src/components/note/index.js
@@ -445,11 +445,12 @@ const topicNoteMenuItems = [
throw new Error("context is missing");
const ids = items.map((i) => i.id);
- const topic = db.notebooks
- .notebook(context.value.id)
- ?.topics?.topic(context.value.topic);
- if (!topic) throw new Error("topic not found");
- await topic.delete(...ids);
+
+ await db.notes.removeFromNotebook(
+ { id: context.value.id, topic: context.value.topic },
+ ...ids
+ );
+
store.refresh();
showToast("success", "Note removed from topic.");