Skip to content

Commit

Permalink
Added Update Menu Items
Browse files Browse the repository at this point in the history
  • Loading branch information
adiwya24 committed Mar 15, 2024
1 parent 3e001a4 commit 74119de
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/services/menu-items.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ export class MenuItemsService {
.pipe(map((res) => res['menuItem']));
}

updateMenuItem(
menuItemId: string,
updatedMenuItem: MenuItem,
): Observable<MenuItem> {
const url = `${this.API_URL}/menuitems/${menuItemId}`;
const headers = this.authService.getAuthHeaders();

return this.http
.put<MenuItem>(url, updatedMenuItem, { headers })
.pipe(map((res: any) => res));
}

deleteMenuItem(menuItemId: string): Observable<any> {
const url = `${this.API_URL}/menuitems/${menuItemId}`;
const headers = this.authService.getAuthHeaders();
Expand Down

0 comments on commit 74119de

Please sign in to comment.