preliminary map for vehicles
This commit is contained in:
@@ -9,10 +9,10 @@ const vehiclesAPI = {
|
||||
body: JSON.stringify(vehicle),
|
||||
})
|
||||
.then(fetchRespHandler),
|
||||
|
||||
|
||||
getVehicles: async (search, token) => {
|
||||
const u = addQueryParams(`${API_ENDPOINT}/vehicles`, search);
|
||||
return fetch(u, {
|
||||
return fetch(u, {
|
||||
method: "GET",
|
||||
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
|
||||
})
|
||||
@@ -20,10 +20,10 @@ const vehiclesAPI = {
|
||||
},
|
||||
|
||||
getModels: async (token) => fetch(`${API_ENDPOINT}/vehiclemodels`, {
|
||||
method: "GET",
|
||||
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
|
||||
})
|
||||
.then(fetchRespHandler),
|
||||
method: "GET",
|
||||
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
|
||||
})
|
||||
.then(fetchRespHandler),
|
||||
|
||||
getYears: async (token) => fetch(`${API_ENDPOINT}/vehicleyears`, {
|
||||
method: "GET",
|
||||
@@ -39,15 +39,22 @@ const vehiclesAPI = {
|
||||
}),
|
||||
})
|
||||
.then(fetchRespHandler),
|
||||
|
||||
|
||||
getConnections: async (vins, token) => {
|
||||
const u = `${API_ENDPOINT}/carsconnected?vins=${vins.join(",")}`
|
||||
return fetch(u, {
|
||||
return fetch(u, {
|
||||
method: "GET",
|
||||
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
},
|
||||
|
||||
getLocations: async (token) => fetch(`${API_ENDPOINT}/carslocations`, {
|
||||
method: "GET",
|
||||
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
|
||||
})
|
||||
.then(fetchRespHandler),
|
||||
|
||||
};
|
||||
|
||||
export default vehiclesAPI;
|
||||
|
||||
Reference in New Issue
Block a user