CEC-5900 - Add the ability to edit Flashpack versions after they are added

This commit is contained in:
padamsen_fisker
2024-04-02 19:38:31 -04:00
parent f4f0db4f24
commit 5f3fce37bc
9 changed files with 979 additions and 4 deletions

View File

@@ -295,6 +295,18 @@ const vehiclesAPI = {
.catch(errorHandler)
},
addFlashpackVersionECUMapping: async (model, trim, year, flashpack, data, token) => {
return fetch(`${API_ENDPOINT}/flashpack_version_ecu_mapping/${model}/${trim}/${year}/${flashpack}`, {
method: "POST",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token),
),
body: JSON.stringify(data),
}).then(fetchRespHandler)
.catch(errorHandler)
},
deleteFlashpackVersion: async (data, token) => {
return fetch(`${API_ENDPOINT}/flashpack_version`, {
method: "DELETE",
@@ -307,6 +319,17 @@ const vehiclesAPI = {
.catch(errorHandler)
},
deleteFlashpackVersionECUMapping: async (model, trim, year, flashpack, ecuName, ecuVersion, token) => {
return fetch(`${API_ENDPOINT}/flashpack_version_ecu_mapping/${model}/${trim}/${year}/${flashpack}/${ecuName}/${ecuVersion}`, {
method: "DELETE",
headers: Object.assign(
{ "Content-Type": "application/json" },
getAuthHeaderOptions(token)
),
}).then(fetchRespHandler)
.catch(errorHandler)
},
getCarFlashpackVersionInfo: async (vin, token) => {
return fetch(`${API_ENDPOINT}/flashpack_version_info/${vin}`, {
method: "GET",