mirror of
https://github.com/bodyrep/DemoApp.git
synced 2026-01-25 14:43:00 +00:00
can read and display workouts
This commit is contained in:
@@ -9,7 +9,7 @@ var UserSchema = new mongoose.Schema({
|
||||
|
||||
UserSchema.methods.recentworkouts = function(callback) {
|
||||
return this.model('workout')
|
||||
.find({author: this._id})
|
||||
.find({userID: this._id})
|
||||
//.sort('created_at', 1)
|
||||
.limit(5)
|
||||
.exec(callback);
|
||||
|
||||
@@ -2,13 +2,13 @@ var Schema = require('mongoose').Schema;
|
||||
|
||||
|
||||
var Split = new Schema({
|
||||
reps: { type: String},
|
||||
weight: { type: String}
|
||||
reps: String,
|
||||
weight: String
|
||||
});
|
||||
|
||||
|
||||
var Element = new Schema({
|
||||
ExerciseID: { type: String},
|
||||
exerciseID: String,
|
||||
splits: [Split]
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user