api: add default General topic in notebook

This commit is contained in:
thecodrr
2019-12-05 17:45:45 +05:00
parent bc2e9f986e
commit 35e2053943

View File

@@ -105,9 +105,10 @@ class Database {
async addNotebook(notebook) {
if (!notebook || !notebook.title) return;
const id = notebook.dateCreated || Date.now();
let topics = {};
let topics = { General: [] };
if (notebook.topics) {
for (let topic of notebook.topics) {
if (!topic) continue;
topics[topic] = [];
}
}