0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-03 08:22:42 +00:00

admin panel should be good

This commit is contained in:
Scott
2016-02-19 15:59:57 -05:00
parent a1b8d4e8ce
commit fd871aa04a
3 changed files with 51 additions and 28 deletions

View File

@@ -45,6 +45,7 @@ module.exports = function(app){
app.get('/homebrew/remove/:id', function(req, res){
if(req.query && req.query.admin_key == process.env.ADMIN_KEY){
HomebrewModel.find({editId : req.params.id}, function(err, objs){
console.log(err);
if(!objs.length || err) return res.status(404).send("Can not find homebrew with that id");
var resEntry = objs[0];
resEntry.remove(function(err){