diff options
| author | Kumar Damani <kumar.damani@mail.utoronto.ca> | 2019-03-15 16:51:25 +0000 |
|---|---|---|
| committer | Kumar Damani <kumar.damani@mail.utoronto.ca> | 2019-03-15 16:51:25 +0000 |
| commit | 4b696da0334a92a00119ab4a5c0414a79f39da4f (patch) | |
| tree | 38dd0a78c026ca24c0b81852139757902f9e099f /web/routes | |
| parent | dadc8489761294dc67edc89d553395512c697c40 (diff) | |
updated mobile form, updated web schemas, and /mobilerequest handler. No front end web changes yet
Diffstat (limited to 'web/routes')
| -rw-r--r-- | web/routes/index.js | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/web/routes/index.js b/web/routes/index.js index b2ba91f..a93db3b 100644 --- a/web/routes/index.js +++ b/web/routes/index.js @@ -23,14 +23,8 @@ router.get('/map', function(req,res) { }); router.post('/mobilerequest', function(req, res) { - var data = { - 'coordinates': req.body.coordinates, - 'type': req.body.type, - 'isInjured': req.body.isInjured, - 'reasonForHelp': req.body.reasonForHelp, - 'ageRange': req.body.ageRange, - 'clothingDescription': req.body.clothingDescription - } + console.log(req.body); + var data = req.body; Points.save_request(data, function(err, result) { if (err) { console.log(`err inserting mobile request into db: ${err}`); @@ -44,7 +38,7 @@ router.post('/mobilerequest', function(req, res) { res.status(200).send({'status': 'success', 'data': data}); } }); - + }); |
