Skip to content
Snippets Groups Projects
Commit 6c3eba9e authored by Samuli Virtapohja's avatar Samuli Virtapohja
Browse files

change tracking format

parent 14cd59aa
No related branches found
No related tags found
2 merge requests!59Development to master,!36Development
......@@ -29,7 +29,7 @@ export class TrackingController {
@Param('id') id,
@Body() trackdata: TrackingDTO,
) {
return this.trackingservice.trackLocation(userId, id, trackdata);
return this.trackingservice.trackLocation(userId, id, trackdata[0]);
}
@Get('players/:id')
......
......@@ -39,9 +39,7 @@ export class TrackingService {
await this.mapFunction(trackdata.data['geometry']['coordinates']),
);
//add timestamp
trackedperson.data['geometry']['properties']['time'].push(
new Date(Date.now()),
);
trackedperson.data['properties']['time'].push(new Date(Date.now()));
return await this.trackingrepository.save(trackedperson);
} else {
......@@ -49,7 +47,7 @@ export class TrackingService {
// initialize coordinates
trackdata.data['geometry']['coordinates'] = [];
// initialize timestamp
trackdata.data['geometry']['properties']['time'] = [];
trackdata.data['properties']['time'] = [];
trackedperson = await this.trackingrepository.create(trackdata);
trackedperson.faction = gameperson.faction;
trackedperson.game = gameId;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment