feat: add types for all entities

This commit is contained in:
thecodrr
2019-12-06 16:53:57 +05:00
parent 825f444366
commit 49bc485bc5

View File

@@ -43,6 +43,7 @@ class Database {
.slice(0, 3) .slice(0, 3)
.join(" "); .join(" ");
this.notes[timestamp] = { this.notes[timestamp] = {
type: "note",
title, title,
content: note.content, content: note.content,
pinned: note.pinned || false, pinned: note.pinned || false,
@@ -113,6 +114,7 @@ class Database {
} }
} }
this.notebooks[id] = { this.notebooks[id] = {
type: "notebook",
title: notebook.title, title: notebook.title,
description: notebook.description, description: notebook.description,
dateCreated: id, dateCreated: id,
@@ -286,6 +288,7 @@ function getItem(id, key) {
function makeTopic(topic) { function makeTopic(topic) {
return { return {
type: "topic",
title: topic, title: topic,
dateCreated: Date.now(), dateCreated: Date.now(),
totalNotes: 0, totalNotes: 0,