Skip to content
Snippets Groups Projects
Commit a4e1b899 authored by Øivind Haugerøy Larsson's avatar Øivind Haugerøy Larsson
Browse files

kjør2

parent 0dce86f2
No related branches found
No related tags found
No related merge requests found
Pipeline #22821 passed
node_modules/
\ No newline at end of file
......@@ -22,7 +22,14 @@ module.exports = class PersonDao extends Dao {
);
}
updateOne() {
updateOne(id, json, callback) {
super.query(
"update person set navn=?, adresse=?, alder=? where id=?",
[json.navn],
[json.adresse],
[json.alder],
[id],
callback
)
}
};
This diff is collapsed.
......@@ -41,4 +41,12 @@ app.post("/person", (req, res) => {
});
});
app.post("/person/:personId", (req, res) => {
console.log("Fikk POST-request fra klient, update");
personDao.updateOne(req.body, (status, data) => {
res.status(status);
res.json(data);
})
})
var server = app.listen(8080);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment