mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-16 17:21:29 +00:00
Added in new page, however edit page is still broken
This commit is contained in:
@@ -34,9 +34,17 @@ module.exports = function(app){
|
||||
getTopBrews(function(topBrews){
|
||||
return res.json(topBrews);
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
app.put('/homebrew/update/:id', function(req, res){
|
||||
app.post('/homebrew/api', function(req, res){
|
||||
var newHomebrew = new HomebrewModel(req.body);
|
||||
newHomebrew.save(function(err, obj){
|
||||
if(err) return;
|
||||
return res.json(obj);
|
||||
})
|
||||
});
|
||||
|
||||
app.put('/homebrew/api/update/:id', function(req, res){
|
||||
HomebrewModel.find({editId : req.params.id}, function(err, objs){
|
||||
if(!objs.length || err) return res.status(404).send("Can not find homebrew with that id");
|
||||
var resEntry = objs[0];
|
||||
|
||||
Reference in New Issue
Block a user