From f916936e9d310b0dec3f715e98e91a4887750f72 Mon Sep 17 00:00:00 2001
From: Vegard46 <veg_ander@hotmail.com>
Date: Mon, 24 Sep 2018 20:52:51 +0200
Subject: [PATCH] methods

---
 .idea/misc.xml   |  6 ++++++
 .idea/vcs.xml    |  6 ++++++
 dao/persondao.js | 16 ++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 .idea/misc.xml
 create mode 100644 .idea/vcs.xml

diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..28a804d
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="JavaScriptSettings">
+    <option name="languageLevel" value="ES6" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/dao/persondao.js b/dao/persondao.js
index 987542b..5839d1d 100644
--- a/dao/persondao.js
+++ b/dao/persondao.js
@@ -21,4 +21,20 @@ module.exports = class PersonDao extends Dao {
       callback
     );
   }
+
+  updateOne(id, json, callback) {
+    var val = [json.navn, json.adresse, json.alder, id];
+    super.query(
+        "update person set navn = ?, adresse = ?, alder = ? where id = ?",
+        val,
+        callback
+    );
+  }
+
+  deleteOne(id, callback) {
+    super.query(
+        "delete from person where id = ?",
+        callback
+    );
+  }
 };
-- 
GitLab