[enh] There should be a patch method. Also, DOM events should work...
This commit is contained in:
parent
b0c6043741
commit
77ccaef87d
3 changed files with 154 additions and 54 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue