From 850e79afd89a823457d18692c046ff164faa83f4 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Tue, 23 Aug 2016 14:52:48 -0400 Subject: [PATCH] using req.body to create run in DB --- controllers/runs.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/controllers/runs.js b/controllers/runs.js index 471597e..cf7b513 100644 --- a/controllers/runs.js +++ b/controllers/runs.js @@ -11,10 +11,7 @@ controller.get('/:id', function(req, res){ }); controller.post('/', function(req, res){ - Run.create({ - date: new Date('2016-1-1'), - distance: 5.5 - }).then(function(createdRun){ + Run.create(req.body).then(function(createdRun){ //createdRun is the object representation of the row created in the DB res.json(createdRun); });