menus
This commit is contained in:
parent
056576b87f
commit
388804ae06
5 changed files with 171 additions and 52 deletions
|
|
@ -44,13 +44,17 @@ apiUrl: string;
|
|||
|
||||
}
|
||||
|
||||
deleteMenu(id: any): Observable<any> {
|
||||
return this.http.delete(`${this.apiUrl}/menus/delete/`+ id);
|
||||
deleteMenu(id:number): Observable<any> {
|
||||
return this.http.delete(`${this.apiUrl}/menus/delete/${id}`);
|
||||
}
|
||||
|
||||
updateMenu(menu: Menu): Observable<any> {
|
||||
return this.http.put(`${this.apiUrl}/contacts/update/`, menu);
|
||||
}
|
||||
|
||||
updateMenu(menu: Menu, id:number): Observable<any> | void {
|
||||
const teamId = this.tokenService.getCurrentTeamId();
|
||||
if (teamId){
|
||||
return this.http.put(`${this.apiUrl}/menus/update/${teamId}/${id}`, menu);
|
||||
}else {
|
||||
this.router.navigate(['accueil']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue