CEC-4772 - carsconnected takes VINs in req body (#397)

This commit is contained in:
Paul Adamsen
2023-07-24 16:01:39 -04:00
committed by GitHub
parent c572e5de5b
commit d6d1b3107e
4 changed files with 7 additions and 6 deletions

View File

@@ -116,7 +116,7 @@ const vehiclesAPI = {
getConnections: async (vins) => {
const result = {};
vins.forEach((vin) => {
vins.VINs.forEach((vin) => {
result[vin] = true;
result["2:" + vin] = false;
});

View File

@@ -41,13 +41,14 @@ const vehiclesAPI = {
.catch(errorHandler),
getConnections: async (vins, token) => {
const u = `${API_ENDPOINT}/carsconnected?vins=${vins.join(",")}`;
const u = `${API_ENDPOINT}/carsconnected`;
return fetch(u, {
method: "GET",
method: "POST",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
body: JSON.stringify(vins),
})
.then(fetchRespHandler)
.catch(errorHandler);