Update: Docker dev + logout on frontend
This commit is contained in:
parent
03fbbb4114
commit
0d6fde6aba
4 changed files with 15 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import {Component, Input, OnInit} from '@angular/core';
|
||||
import {ProfilService} from "../../services/profil/profil.service";
|
||||
import {MessageService} from "../../services/message/message.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-navbar',
|
||||
|
|
@ -10,14 +11,22 @@ export class NavbarComponent implements OnInit
|
|||
{
|
||||
@Input() pour = "login";
|
||||
|
||||
constructor(private profilService: ProfilService) { }
|
||||
constructor(private profilService: ProfilService, private messageService: MessageService) { }
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
onDeconnexion(): void
|
||||
{
|
||||
this.messageService
|
||||
.delete('logout')
|
||||
.subscribe(retour => this.onDeconnexionCallback(retour), err => this.onDeconnexionCallback(err));
|
||||
this.profilService.setId(-1);
|
||||
this.profilService.setIsAdmin(false);
|
||||
}
|
||||
|
||||
onDeconnexionCallback(retour: any): void
|
||||
{
|
||||
if(retour.status !== "success") console.log(retour);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue