trucs de menu et token

This commit is contained in:
Blandine Bajard 2022-03-01 17:32:16 +01:00
parent 1d96834459
commit 476cc12cc0
7 changed files with 18 additions and 12 deletions

View file

@ -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"});
}

View file

@ -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;