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

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

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