Skip to content

Commit a985edc

Browse files
committed
Adding fields to drones and service, fixes 5
1 parent 4b24122 commit a985edc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services/DroneService.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ function *updateLocation(id, entity, returnNFZ, nfzFields, nfzLimit, nearDronesM
264264
throw new errors.NotFoundError(`Current logged in provider does not have this drone , id = ${id}`);
265265
}
266266

267-
drone.currentLocation = [entity.lng || drone.currentLocation[0], entity.lat || drone.currentLocation[1]];
267+
entity.lng = entity.lng || drone.currentLocation[0];
268+
entity.lat = entity.lat || drone.currentLocation[1];
269+
drone.currentLocation = [entity.lng, entity.lat];
268270
drone.status = entity.status || drone.status;
269271
drone.altitude = entity.altitude;
270272
drone.heading = entity.heading;

0 commit comments

Comments
 (0)