summaryrefslogtreecommitdiff
path: root/src/db.js
diff options
context:
space:
mode:
authorLeo Goetz <dev@leogtz.de>2025-11-09 14:19:26 +0100
committerLeo Goetz <dev@leogtz.de>2025-11-09 14:19:26 +0100
commit789d28b83af165258dc7e8b3a44bbd2d48fcc370 (patch)
treee98ef728fb42a7bc03aef6d6a601e0533a4961b3 /src/db.js
parent16a0e9a9d2c24af28142ed3420ef6cb373c454f7 (diff)
added crud functionality with json file as a db
Diffstat (limited to 'src/db.js')
-rw-r--r--src/db.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/db.js b/src/db.js
index 39fdc29..087686a 100644
--- a/src/db.js
+++ b/src/db.js
@@ -14,4 +14,7 @@ export const saveDB = async (db) => {
export const insertDB = async (note) => {
const db = await getDB();
+ db.notes.push(note);
+ await saveDB(db);
+ return note;
};