|
@@ -53,6 +53,8 @@ export class MenuItemsComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.menuItems = JSON.parse(JSON.stringify(this.profile_info.menuitems)); |
|
|
this.menuItems = JSON.parse(JSON.stringify(this.profile_info.menuitems)); |
|
|
|
|
|
|
|
|
|
|
|
console.log(this.menuItems); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
updateItem(menuItem) { |
|
|
updateItem(menuItem) { |
|
@@ -81,7 +83,31 @@ export class MenuItemsComponent implements OnInit { |
|
|
|
|
|
|
|
|
addNewItem() { |
|
|
addNewItem() { |
|
|
this.itemService.addMenuItem(this.newItem, this.profile_info.outlet_id).then((data) => { |
|
|
this.itemService.addMenuItem(this.newItem, this.profile_info.outlet_id).then((data) => { |
|
|
console.log(data); |
|
|
|
|
|
|
|
|
this.menuItems.push(data); |
|
|
|
|
|
this.profile_info.menuitems = this.menuItems; |
|
|
|
|
|
|
|
|
|
|
|
if (this.profile_type === 'VENDOR') { |
|
|
|
|
|
localStorage.vendor_info = JSON.stringify(this.profile_info); |
|
|
|
|
|
} else if (this.profile_type === 'OUTLET') { |
|
|
|
|
|
localStorage.outlet_info = JSON.stringify(this.profile_info); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.showAddItemModal = false; |
|
|
|
|
|
|
|
|
|
|
|
this.newItem = { |
|
|
|
|
|
image_url: '', |
|
|
|
|
|
is_available: false, |
|
|
|
|
|
is_vegetarian: true, |
|
|
|
|
|
item_categories: [], |
|
|
|
|
|
item_discount: null, |
|
|
|
|
|
item_price: null, |
|
|
|
|
|
menu_item_name: '', |
|
|
|
|
|
rating: 3, |
|
|
|
|
|
soft_delete: false, |
|
|
|
|
|
wait_duration:"00:30:00" |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
}, (err) => { |
|
|
}, (err) => { |
|
|
alert("Failed to create item"); |
|
|
alert("Failed to create item"); |
|
|
}) |
|
|
}) |
|
|