show only runs created by a specific user

master relations
Matt Huntington 9 years ago
parent 05af2d5590
commit 439925e4d5

@ -6,8 +6,10 @@ var Runs = require('../models/run.js');
controller.use(bodyParser.json());
controller.get('/', function(req, res){
Runs.findAll().then(function(runs){
res.json(runs);
Users.findById(req.session.currentUser.id).then(function(user){
user.getRuns().then(function(runs){
res.json(runs);
});
});
});

Loading…
Cancel
Save