aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/models/mockpoints.js10
-rw-r--r--web/models/points.js10
-rw-r--r--web/routes/index.js12
3 files changed, 15 insertions, 17 deletions
diff --git a/web/models/mockpoints.js b/web/models/mockpoints.js
index ff5e771..ac9ecd4 100644
--- a/web/models/mockpoints.js
+++ b/web/models/mockpoints.js
@@ -5,10 +5,12 @@ var Schema = mongoose.Schema;
var dumbJsonSchema = new Schema({
type: String,
coordinates: Array,
- ageRange: String,
- clothingDescription: String,
- isInjured: Boolean,
- reasonForHelp: String
+ gender: String,
+ age: String,
+ race: String,
+ longhair: Boolean,
+ longbeard: Boolean,
+ extra: String
});
// Mongoose Model definition
diff --git a/web/models/points.js b/web/models/points.js
index 3a07c82..d27f2a7 100644
--- a/web/models/points.js
+++ b/web/models/points.js
@@ -5,10 +5,12 @@ var Schema = mongoose.Schema;
var JsonSchema = new Schema({
type: String,
coordinates: Array,
- ageRange: String,
- clothingDescription: String,
- isInjured: Boolean,
- reasonForHelp: String
+ gender: String,
+ age: String,
+ race: String,
+ longhair: Boolean,
+ longbeard: Boolean,
+ extra: String
});
// Mongoose Model definition
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});
}
});
-
+
});