feat: allow note to be in multiple notebooks and topics

This commit is contained in:
thecodrr
2020-12-05 12:38:15 +05:00
parent 23daab7266
commit 97d396a01e
7 changed files with 46 additions and 40 deletions

View File

@@ -177,10 +177,12 @@ const migrations = {
if (await migrations.handleDeleted(db, "notes", item)) return;
const contentId = item.content.delta;
const notebook = item.notebook;
delete item.content;
delete item.notebook;
item.contentId = contentId;
item.remote = true;
if (!item.notebook.id) item.notebook = undefined;
if (notebook) item.notebooks = [notebook];
await db.notes.add(item);
},
delta: async function (db, item) {