mirror of
https://github.com/bodyrep/DemoApp.git
synced 2026-01-26 07:01:38 +00:00
added methods and routes for getting an exercises history, and the sum of a workouts musclearrays -- incl a modifier
This commit is contained in:
@@ -11,6 +11,7 @@ var loggedIn = require('./middleware/logged_in');
|
||||
var maxWorkoutsPerPage = 5;
|
||||
var Exercise = require('../data/models/exercise');
|
||||
var loadExercise = require('./middleware/load_exercise');
|
||||
var MuscleArray = require('./middleware/musclearray');
|
||||
var Moment = require('moment');
|
||||
|
||||
module.exports = function(app) {
|
||||
@@ -60,8 +61,11 @@ module.exports = function(app) {
|
||||
});
|
||||
|
||||
|
||||
app.get('/workouts/:_id', loadWorkout, function(req, res, next){
|
||||
app.get('/workouts/:_id', loggedIn, loadWorkout, function(req, res, next){
|
||||
console.log("time" + Moment.utc(req.workout.workoutDate).format("ddd, hA"));
|
||||
var output = MuscleArray(req.workout);
|
||||
console.log('output - ' + JSON.stringify(output));
|
||||
|
||||
res.render('workouts/workout', {title: req.workout.title,
|
||||
workout: req.workout,
|
||||
workouttime: Moment.utc(req.workout.workoutDate).format("ddd, hA")
|
||||
|
||||
Reference in New Issue
Block a user