CEC-5443 - Ability to add Flashpack/ECU mappings
This commit is contained in:
@@ -260,6 +260,52 @@ const vehiclesAPI = {
|
||||
}).then(fetchRespHandler)
|
||||
.catch(errorHandler)
|
||||
},
|
||||
|
||||
getAllFlashpacks: async (options, token) => {
|
||||
return fetch(addQueryParams(`${API_ENDPOINT}/flashpack_get_all`, options), {
|
||||
method: "GET",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
}).then(fetchRespHandler)
|
||||
.catch(errorHandler)
|
||||
},
|
||||
|
||||
getFlashpackECUMappings: async (model, year, flashpack, options, token) => {
|
||||
return fetch(addQueryParams(`${API_ENDPOINT}/flashpack_ecu_mappings/${model}/${year}/${flashpack}`, options), {
|
||||
method: "GET",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
}).then(fetchRespHandler)
|
||||
.catch(errorHandler)
|
||||
},
|
||||
|
||||
addFlashpackECUMapping: async (data, token) => {
|
||||
return fetch(`${API_ENDPOINT}/flashpack_ecu_mapping`, {
|
||||
method: "POST",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token),
|
||||
),
|
||||
body: JSON.stringify(data),
|
||||
}).then(fetchRespHandler)
|
||||
.catch(errorHandler)
|
||||
},
|
||||
|
||||
deleteFlashpackECUMapping: async (data, token) => {
|
||||
return fetch(`${API_ENDPOINT}/flashpack_ecu_mapping`, {
|
||||
method: "DELETE",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
body: JSON.stringify(data),
|
||||
}).then(fetchRespHandler)
|
||||
.catch(errorHandler)
|
||||
},
|
||||
};
|
||||
|
||||
export default vehiclesAPI;
|
||||
|
||||
Reference in New Issue
Block a user