Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions api/routes/uploads.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ server.post('/uploads', function(req, res, next) {

if (err || result.statusCode != 200) {
cb(err);
}

cb(null);
} else {

cb(null);
}
});

},
Expand All @@ -273,25 +273,25 @@ server.post('/uploads', function(req, res, next) {

if (err) {
cb(err);
}
} else {

// if the location was found
if (location.features.length) {

// if the location was found
if (location.features.length) {
// extract coorindates
var coords = location.features[0].geometry.coordinates;
if (coords.length) {

// extract coorindates
var coords = location.features[0].geometry.coordinates;
if (coords.length) {
// assign to latitude and longitude in data object
data.longitude = coords[0];
data.latitude = coords[1];

// assign to latitude and longitude in data object
data.longitude = coords[0];
data.latitude = coords[1];
}

}

cb(null)
}

cb(null)

});

},
Expand All @@ -304,13 +304,13 @@ server.post('/uploads', function(req, res, next) {

if (err) {
cb(err);
}
} else {

// use object assign to merge the object id
result = Object.assign({}, { id: result.insertId }, data);

cb(null, result);
// use object assign to merge the object id
result = Object.assign({}, { id: result.insertId }, data);

cb(null, result);
}
});

},
Expand Down