Menu Section Items

Create menu section item

import { MenuSectionsApi, MenuSectionItemBase } from '@flipdish/api-client-typescript'

let menuId: number = <menu id>;
let menuSectionId: number = <section id>;

let menuSectionItemsApi = new MenuSectionItemsApi();
    
let menuSectionItem = new MenuSectionItemBase();
menuSectionItem.Name = "Sample item";
menuSectionItem.Description = "Sample menu section item";
menuSectionItem.IsAvailable = true;
menuSectionItem.Price = 2.99;    

menuSectionItemsApi.createMenuSectionItem(menuId, menuSectionId,  menuSectionItem)
.then(response => {
  if (response.response.statusCode == 201) {
    console.log("Menu section item created at: " + response.response.headers.location);
  }
}).catch(error => {
  console.log(error);
})

Update menu section item

import { MenuSectionsApi, MenuSectionItemBase } from '@flipdish/api-client-typescript'

let menuId: number = <menu id>;
let menuSectionId: number = <section id>;
let menuSectionItemId: number = <section item id>;

let menuSectionItemsApi = new MenuSectionItemsApi();
    
let menuSectionItem = new MenuSectionItemBase();
menuSectionItem.Name = "Sample item";
menuSectionItem.Description = "Sample menu section item";
menuSectionItem.Price = 1.99;    

menuSectionItemsApi.updateMenuSectionItem(menuId, menuSectionId, menuSectionItemId,  menuSectionItem)
.then(response => {
  if (response.response.statusCode == 200) {
    console.log("Menu section item updated");
  }
}).catch(error => {
  console.log(error);
})

Delete menu section item

import { MenuSectionsApi } from '@flipdish/api-client-typescript'

let menuId: number = <menu id>;
let menuSectionId: number = <section id>;
let menuSectionItemId: number = <section item id>;

let menuSectionItemsApi = new MenuSectionItemsApi(); 

menuSectionItemsApi.deleteMenuSectionItem(menuId, menuSectionId, menuSectionItemId)
.then(response => {
  if (response.response.statusCode == 200) {
    console.log("Menu section item deleted");
  }
}).catch(error => {
  console.log(error);
})