Co-authored-by: Alexander Andrews <aandrews@fiskerinc.com>
This commit is contained in:
committed by
GitHub
parent
b45c70bd52
commit
58890ea40e
@@ -85,9 +85,11 @@ const vehiclesAPI = {
|
||||
data: ["Ocean", "Pear"],
|
||||
};
|
||||
},
|
||||
getLocations: async (token, locationFilter) => {
|
||||
return {data:[{ altitude: 0, longitude: 10, latitude: 15, vin: "TESTVIN123"}] }
|
||||
},
|
||||
getLocations: jest
|
||||
.fn()
|
||||
.mockResolvedValue([
|
||||
{ altitude: 5, longitude: 10, latitude: 15, vin: "TESTVIN123" },
|
||||
]),
|
||||
getVehicle: async (vin) => {
|
||||
const index = data.findIndex(element => element.vin === vin);
|
||||
return data[index];
|
||||
|
||||
@@ -68,14 +68,13 @@ const vehiclesAPI = {
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
getLocations: async (token, mapLocationInfo) =>
|
||||
getLocations: async (token) =>
|
||||
fetch(`${API_ENDPOINT}/carslocations`, {
|
||||
method: "POST",
|
||||
method: "GET",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
body: JSON.stringify(mapLocationInfo)
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
Reference in New Issue
Block a user