import axios from "axios";
import {API} from "../config";

export const getDistance = (values)=>{
    return axios.get(`${API.getDistance}/GetDistance?travelFrom=${values.from}&travelTo=${values.to}`)
    .then((response)=>{
        return response;
    })
    .catch((error)=>{
        return error.response.data;
    })
}

export const getZipCode = (value)=>{
    return axios.get(`${API.getDistance}/GetZipCode?zipCode=${value}`)
    .then((response)=>{
        return response;
    })
    .catch((error)=>{
        return error.response.data;
    })
    
}