CEC-4100: Added push config changes to vin (#338)

This commit is contained in:
Alexander Andrews
2023-05-23 17:16:46 -04:00
committed by GitHub
parent 8e71cf6c8c
commit bf0fb5363b
12 changed files with 638 additions and 1683 deletions

View File

@@ -173,6 +173,17 @@ const vehiclesAPI = {
.then(fetchRespHandler)
.catch(errorHandler),
updateConfig: async (vin, token) =>
fetch(`${API_ENDPOINT}/car_config/${vin}`, {
method: "POST",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
)
})
.then(fetchRespHandler)
.catch(errorHandler),
getCANSignals: async (vin, token) =>
fetch(`${API_ENDPOINT}/cansignals/${vin}`, {
method: "GET",
@@ -209,15 +220,15 @@ const vehiclesAPI = {
.catch(errorHandler)
},
getLogFileLink: async ({vin, year, month, day}, token) => {
const u = `${API_ENDPOINT}/vehicle/${vin}/trex-logs-link?year=${year}&month=${month}&day=${day}`
return fetch(u, {
method: "GET",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
}).then(fetchRespHandler)
getLogFileLink: async ({ vin, year, month, day }, token) => {
const u = `${API_ENDPOINT}/vehicle/${vin}/trex-logs-link?year=${year}&month=${month}&day=${day}`
return fetch(u, {
method: "GET",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
}).then(fetchRespHandler)
.catch(errorHandler)
},
};