fix errore user.id can be undefined
This commit is contained in:
@@ -94,9 +94,9 @@ export class DetailComponent implements OnInit {
|
|||||||
// implement this nex line in angular ts
|
// implement this nex line in angular ts
|
||||||
this.myModal.nativeElement.checked = true;
|
this.myModal.nativeElement.checked = true;
|
||||||
this.userService.getUser("tito").subscribe(user => {
|
this.userService.getUser("tito").subscribe(user => {
|
||||||
if (user.id !== undefined) {
|
if (user?.id !== undefined) {
|
||||||
let waypointVisited: WaypointsVisitedEntity = {userId: user.id , waypointId: this.waypointInfo.id}
|
let waypointVisited: WaypointsVisitedEntity = {userId: user.id , waypointId: this.waypointInfo.id}
|
||||||
console.log("waypointVisited", waypointVisited)
|
console.log("waypointVisited", waypointVisited)
|
||||||
this.waypointVisitedService.createWaypoint(waypointVisited)
|
this.waypointVisitedService.createWaypoint(waypointVisited)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user