function checkRestaurantId(restaurantId){
  const userID = restaurantId.substr(restaurantId.indexOf('restaurantID=')+13, 24);
  return {
    type: types.VERIFY_RESTAURANT_ID,
    payload: axios
    .get(`https://grubtoeat.herokuapp.com/api/Restaurants/${userID}`)
    .then(res => {
      return {
        isValid: res.status == 200,
        restaurantId: res.data.id
      };
    })
    .catch(console.error)
  }
}
//Checks (via GET) if logged in user has valid restaurantID 
Checks (via GET) if logged in user has valid restaurantID
Checks ( via GET ) if logged in user has valid restaurantID
function checkRestaurantId(restaurantId){
  const userID = restaurantId.substr(restaurantId.indexOf('restaurantID=')+13, 24);
  return {
    type: types.VERIFY_RESTAURANT_ID,
    payload: axios
    .get(`https://grubtoeat.herokuapp.com/api/Restaurants/${userID}`)
    .then(res => {
      return {
        isValid: res.status == 200,
        restaurantId: res.data.id
      };
    })
    .catch(console.error)
  }
}
function checkRestaurantId ( restaurantId ) { const userID = restaurantId . substr ( restaurantId . indexOf ( 'restaurantID=' ) + 13 , 24 ) ; return { type : types . VERIFY_RESTAURANT_ID , payload : axios . get ( ` ${ userID } ` ) . then ( res => { return { isValid : res . status == 200 , restaurantId : res . data . id } ; } ) . catch ( console . error ) } }
Checks (via GET) if logged in user has valid restaurantID
Checks ( via GET ) if logged in user has valid restaurantID