1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-23 01:01:28 +00:00

moved welcome message and adding in egads errors

This commit is contained in:
Scott Tolksdorf
2017-01-01 10:38:36 -08:00
parent 1173af5803
commit 95c09ba7ad
8 changed files with 82 additions and 142 deletions

View File

@@ -32,25 +32,13 @@ const Middleware = {
if(req.isAdmin) return next();
return res.sendStatus(401);
},
validate : (req, res, next) => {
//Only allow admin or brew authors pass.
return next();
},
//Loaders
loadBrew : (req, res, next) => {
//Loads a brew by edit id
if(req.params.shareId){
BrewData.get({ shareId : req.params.shareId})
.then((brew))
}else if(req.params.editId){
}else{
return next();
}
//TODO: move validate into hurrr
},
viewBrew : (req, res, next) => {
//load by share