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