Changed polygon output to be more friendly

This commit is contained in:
Umbra Sheep
2018-09-30 20:07:51 +13:00
parent e0377fc548
commit adbea487af
+10 -1
View File
@@ -12,7 +12,16 @@ module.exports = {
return res.send(400); return res.send(400);
} }
// console.log(rows); // console.log(rows);
res.send(rows[0]); let polygon = {}
polygon.coords = [];
rows[0].map((point) => {
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;
});
res.send(polygon);
return; return;
}); });
} else { } else {