Fixed polygons not returning as a list

main
Umbra Sheep 7 years ago
parent adbea487af
commit 57ce322aca

@ -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 = []; polygon.coords = [];
rows[0].map((point) => { rows[0].map((point) => {
let polygon = {};
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 {

Loading…
Cancel
Save