function postItem(menuObj) {
  const { name, description, price, menuId } = menuObj;
  return {
    type: types.POST_ITEM,
    payload: axios
      .post(`https://grubtoeat.herokuapp.com/api/Menus/${menuId}/menuItems`, {
        name,
        description,
        price,
        prepTime: 30
      })
      .then(res => {
        return res.data;
      })
      .catch(console.error)
  };
}
//Creates a menu item to the restaurant's menu
Creates a menu item to the restaurant's menu
Creates a menu item to the restaurant ' s menu
function postItem(menuObj) {
  const { name, description, price, menuId } = menuObj;
  return {
    type: types.POST_ITEM,
    payload: axios
      .post(`https://grubtoeat.herokuapp.com/api/Menus/${menuId}/menuItems`, {
        name,
        description,
        price,
        prepTime: 30
      })
      .then(res => {
        return res.data;
      })
      .catch(console.error)
  };
}
function postItem ( menuObj ) { const { name , description , price , menuId } = menuObj ; return { type : types . POST_ITEM , payload : axios . post ( ` ${ menuId } ` , { name , description , price , prepTime : 30 } ) . then ( res => { return res . data ; } ) . catch ( console . error ) } ; }
Creates a menu item to the restaurant's menu
Creates a menu item to the restaurant ' s menu