migrating repo to Bodyrep org

This commit is contained in:
2013-01-19 11:23:43 -05:00
parent 31b7303f43
commit 4ea082330b
891 changed files with 142706 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
var workout = require('../../data/models/workout');
function loadworkout(req, res, next) {
console.log('fetch id' + req.params.title );
workout.findOne({title: req.params.title})
.populate('elements')
.exec(function(err, workout) {
if (err) {
return next(err);
}
if (! workout) {
return res.send('Not found', 404);
}
console.log('workout' + JSON.stringify(workout));
req.workout = workout;
next();
});
}
module.exports = loadworkout;