Changed polygon output to be more friendly
This commit is contained in:
+10
-1
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user