Skip to content
Snippets Groups Projects
Commit 472e5492 authored by ["Younes MHARRECH"]'s avatar ["Younes MHARRECH"]
Browse files

gestion erreur

parent 93e23fcc
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,6 @@ import { OpenWindowService } from 'src/app/services/open-window.service';
import { AuthService } from 'src/app/services/auth.service';
import { ActivatedRoute } from '@angular/router';
import { User } from 'src/app/models/user';
import { ToastService } from 'src/app/services/toast.service';
@Component({
selector: 'frt-homemap',
......@@ -30,17 +29,19 @@ export class HomemapComponent implements OnInit {
leftPanelVisibility = false;
currentUser!: User;
constructor(private openWindowService: OpenWindowService, public authService: AuthService, private actRoute: ActivatedRoute, private toastService: ToastService, private changeDetectorRef: ChangeDetectorRef) {}
constructor(private openWindowService: OpenWindowService, public authService: AuthService, private actRoute: ActivatedRoute, private changeDetectorRef: ChangeDetectorRef) {}
ngOnInit(): void {
let id = Number(this.actRoute.snapshot.paramMap.get('id'));
this.authService.getUserProfile(id).subscribe((res) => {
this.currentUser = res as User;
this.changeDetectorRef.detectChanges();
},
error => {
this.toastService.show(error);
if (typeof res === "string") {
console.log(res);
}
else{
this.currentUser = res as User;
this.changeDetectorRef.detectChanges();
}
},);
this.openWindowService.openTocEvents.subscribe(status => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment