Skip to content

Commit 400c7b5

Browse files
committed
Merge branch 'master' into dev
2 parents c259133 + 682e4d4 commit 400c7b5

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

src/api/Mission.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class MissionApi {
4545
plannedHomePosition: homePosition,
4646
missionItems: items,
4747
missionName: name,
48+
status:'waiting',
4849
})});
4950
}
5051

@@ -58,6 +59,7 @@ class MissionApi {
5859
plannedHomePosition: homePosition,
5960
missionItems: items,
6061
missionName: name,
62+
status:'waiting',
6163
})});
6264
}
6365

src/api/User.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class UserApi {
2323
}
2424

2525
login(email, password) {
26-
const url = `${this.basePath}/api/v1/users/auth`;
26+
const url = `${this.basePath}/api/v1/login`;
2727

2828
return reqwest({ url: url, method: 'post', type: 'json',
2929
contentType: 'application/json',
@@ -34,19 +34,21 @@ class UserApi {
3434
}
3535

3636
register(name, email, password) {
37-
const url = `${this.basePath}/api/v1/users`;
37+
const url = `${this.basePath}/api/v1/register`;
3838

3939
return reqwest({ url: url, method: 'post', type: 'json',
4040
contentType: 'application/json',
4141
data: JSON.stringify({
42-
name: name,
42+
firstName: name,
43+
lastName: name,
4344
email: email,
45+
phone: "1",
4446
password: password,
4547
})});
4648
}
4749

4850
registerSocialUser(name, email) {
49-
const url = `${this.basePath}/api/v1/users/social`;
51+
const url = `${this.basePath}/api/v1/login/social`;
5052

5153
return reqwest({ url: url, method: 'post', type: 'json',
5254
contentType: 'application/json',

src/components/maps/GoogleMap.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class GoogleMap extends Component {
3535
getMarkerConfig(drone) {
3636
const google = window.google;
3737
const config = { clickable: false, crossOnDrag: false,
38-
cursor: 'pointer', position: new google.maps.LatLng(drone.lat, drone.lng) };
38+
cursor: 'pointer', position: new google.maps.LatLng(drone.currentLocation[0],drone.currentLocation[1]) };
3939
switch (drone.status) {
4040
case 'in-motion':
4141
config.icon = 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png';
@@ -90,7 +90,7 @@ class GoogleMap extends Component {
9090
});
9191
// get a list of all the drones
9292
droneApi.getAll().then((drones) => {
93-
_self.markers = drones.map((single) => {
93+
_self.markers = drones.items.map((single) => {
9494
const marker = new google.maps.Marker(_self.getMarkerConfig(single));
9595
// set the marker id, to identify a drone uniquely
9696
marker.set('id', single.id);
@@ -110,7 +110,7 @@ class GoogleMap extends Component {
110110
// find a marker by id
111111
const marker = _.find(_self.markers, { id: data.id });
112112
if (marker) {
113-
marker.setPosition(new google.maps.LatLng(data.lat, data.lng));
113+
marker.setPosition(new google.maps.LatLng(data.currentLocation[0], data.currentLocation[1]));
114114
// repaint the cluster
115115
_self.markerCluster.repaint();
116116
}

src/components/mission/MissionPlannerList.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ class MissionPlannerList extends Component {
2626

2727
componentDidMount() {
2828
this.missionApi.getAll().then((missions) => {
29-
this.setState({ missions: missions });
29+
this.setState({ missions: missions.items });
3030
});
3131
}
3232

3333
refresh() {
3434
this.missionApi.getAll().then((missions) => {
35-
this.setState({ missions: missions });
35+
this.setState({ missions: missions.items });
3636
});
3737
}
3838

0 commit comments

Comments
 (0)