function updateItem(itemId, updatedState) {
  const updateURL = encodeURI(
    `https://grubtoeat.herokuapp.com/api/MenuItems/update?where={"id":"${
      itemId
    }"}`
  ).replace(/%22:/g, '%22%3A');
  return {
    type: types.PUT_ITEM,
    payload: axios
      .put(updateURL, updatedState)
      .then(res.status === 200 ? getItem(itemId) : null)
      .catch(err => console.log(err))
  };
}
//Updates the restaurant menu items via menu list ID's
Updates the restaurant menu items via menu list ID's
Updates the restaurant menu items via menu list ID ' s
function updateItem(itemId, updatedState) {
  const updateURL = encodeURI(
    `https://grubtoeat.herokuapp.com/api/MenuItems/update?where={"id":"${
      itemId
    }"}`
  ).replace(/%22:/g, '%22%3A');
  return {
    type: types.PUT_ITEM,
    payload: axios
      .put(updateURL, updatedState)
      .then(res.status === 200 ? getItem(itemId) : null)
      .catch(err => console.log(err))
  };
}
function updateItem ( itemId , updatedState ) { const updateURL = encodeURI ( ` ${ itemId } ` ) . replace ( / %22: / g , '%22%3A' ) ; return { type : types . PUT_ITEM , payload : axios . put ( updateURL , updatedState ) . then ( res . status === 200 ? getItem ( itemId ) : null ) . catch ( err => console . log ( err ) ) } ; }
Updates the restaurant menu items via menu list ID's
Updates the restaurant menu items via menu list ID ' s