commit
ba178b22dd
@ -50,11 +50,12 @@ public upMenuForm : FormGroup;
|
||||
|
||||
//delete d'un menu
|
||||
deleteMenu(id_menu : number): void {
|
||||
window.alert("Le menu a bien été supprimé!")
|
||||
// window.alert("Le menu a bien été supprimé!")
|
||||
this.menusService.deleteMenu(id_menu)?.subscribe((resp) => {
|
||||
// this.router.navigate(['menu']);
|
||||
window.location.reload();
|
||||
});
|
||||
window.location.reload();
|
||||
|
||||
}
|
||||
|
||||
//updateMenu
|
||||
@ -76,8 +77,8 @@ updateMenu(id_menu : number): void {
|
||||
|
||||
this.menusService.updateMenu(menu, id_menu)?.subscribe((resp) => {
|
||||
console.log(menu, id_menu);
|
||||
});
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,4 +14,5 @@
|
||||
</div>
|
||||
<a class="navbar-brand" href="#">Organizee</a>
|
||||
</div>
|
||||
<app-deconnexion *ngIf="isLogged"></app-deconnexion>
|
||||
</nav>
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { TokenService } from 'src/app/services/token.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -7,12 +8,19 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./header.component.scss']
|
||||
})
|
||||
export class HeaderComponent implements OnInit {
|
||||
isLogged=false;
|
||||
|
||||
constructor(){
|
||||
|
||||
constructor(public tokenService : TokenService){
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
if(this.tokenService.getToken()){
|
||||
this.isLogged=true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
<app-header></app-header>
|
||||
<app-deconnexion></app-deconnexion>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<app-side-bar></app-side-bar>
|
||||
|
@ -1,9 +1,6 @@
|
||||
<app-header></app-header>
|
||||
<app-side-bar></app-side-bar>
|
||||
|
||||
|
||||
<app-deconnexion></app-deconnexion>
|
||||
|
||||
<div class="container">
|
||||
<div>
|
||||
<h3 class="titre">Bienvenue {{ conectedUser.prenom }}!!</h3>
|
||||
|
@ -45,7 +45,7 @@ apiUrl: string;
|
||||
}
|
||||
|
||||
deleteMenu(id:number): Observable<any> {
|
||||
return this.http.delete(`${this.apiUrl}/menus/delete/${id}`);
|
||||
return this.http.delete(`${this.apiUrl}/menus/delete/${id}`, {responseType:"text"});
|
||||
}
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ tokenKey = environment.tokenKey;
|
||||
public eraseToken(): string | null {
|
||||
const token = localStorage.getItem(this.tokenKey);
|
||||
if(token) {
|
||||
this.tokenKey = '';
|
||||
localStorage.removeItem(this.tokenKey);
|
||||
return token;
|
||||
}else {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user