[enh] There should be a patch method. Also, DOM events should work...

This commit is contained in:
alban 2020-05-24 23:02:56 +02:00
parent b0c6043741
commit 77ccaef87d
3 changed files with 154 additions and 54 deletions

View file

@ -116,12 +116,43 @@ const routes = {
res.end("error");
});
} ,
get: (req, res) => {
const id= req.params.id;
var log = client.get({
index: 'changelog',
id: id
}).then( (results, err) => {
res.json(results);
}, (e) => {
res.status(400);
res.json({msg:"Failed to get record"});
});
},
patch: (req,res) => {
const id= req.params.id;
const content= req.body.content;
var log = client.update({
index: 'changelog',
id: id,
body:{
doc:{
content:content
}
}
}).then( (results, err) => {
res.json(results);
}, (e) => {
res.status(400);
res.json({msg:"Failed to get record"});
}); },
log: (req, res) => {
const id= req.params.id;
var log = client.get({
index: 'changelog',
id: id
id: id
}).then( (results, err) => {
res.render('index', {
title: 'changelog',