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 { ...@@ -29,7 +29,7 @@ export class TrackingController {
@Param('id') id, @Param('id') id,
@Body() trackdata: TrackingDTO, @Body() trackdata: TrackingDTO,
) { ) {
return this.trackingservice.trackLocation(userId, id, trackdata); return this.trackingservice.trackLocation(userId, id, trackdata[0]);
} }
@Get('players/:id') @Get('players/:id')
......
...@@ -39,9 +39,7 @@ export class TrackingService { ...@@ -39,9 +39,7 @@ export class TrackingService {
await this.mapFunction(trackdata.data['geometry']['coordinates']), await this.mapFunction(trackdata.data['geometry']['coordinates']),
); );
//add timestamp //add timestamp
trackedperson.data['geometry']['properties']['time'].push( trackedperson.data['properties']['time'].push(new Date(Date.now()));
new Date(Date.now()),
);
return await this.trackingrepository.save(trackedperson); return await this.trackingrepository.save(trackedperson);
} else { } else {
...@@ -49,7 +47,7 @@ export class TrackingService { ...@@ -49,7 +47,7 @@ export class TrackingService {
// initialize coordinates // initialize coordinates
trackdata.data['geometry']['coordinates'] = []; trackdata.data['geometry']['coordinates'] = [];
// initialize timestamp // initialize timestamp
trackdata.data['geometry']['properties']['time'] = []; trackdata.data['properties']['time'] = [];
trackedperson = await this.trackingrepository.create(trackdata); trackedperson = await this.trackingrepository.create(trackdata);
trackedperson.faction = gameperson.faction; trackedperson.faction = gameperson.faction;
trackedperson.game = gameId; 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