Fixed polygons not returning as a list
This commit is contained in:
+4
-2
@@ -12,16 +12,18 @@ module.exports = {
|
||||
return res.send(400);
|
||||
}
|
||||
// console.log(rows);
|
||||
let polygon = {}
|
||||
let polygons = []
|
||||
polygon.coords = [];
|
||||
rows[0].map((point) => {
|
||||
let polygon = {};
|
||||
polygon.polygonID = point.polygonID;
|
||||
polygon.coords.push({lat: point.lat, lng: point.lng});
|
||||
polygon.gameID = point.gameID;
|
||||
polygon.userID = point.userID;
|
||||
polygon.colour = point.colour;
|
||||
polygons.push(polygon);
|
||||
});
|
||||
res.send(polygon);
|
||||
res.send(polygons);
|
||||
return;
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user