working, just need to prettify
This commit is contained in:
@@ -331,6 +331,27 @@ export const VehicleProvider = ({ children }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const addFlashpackVersion = async (model, year, flashpack, carFlashpackVersions, token) => {
|
||||
try {
|
||||
setBusy(true);
|
||||
|
||||
const data = {
|
||||
"car_model": model,
|
||||
"car_year": year,
|
||||
"flashpack": flashpack,
|
||||
"car_flashpack_versions": carFlashpackVersions,
|
||||
}
|
||||
|
||||
const result = await api.addFlashpackVersion(data, token)
|
||||
if (result.error)
|
||||
throw new Error(`Add flashpack version error. ${result.message}`);
|
||||
|
||||
return result;
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
const deleteFlashpackVersion = async (model, year, flashpack, token) => {
|
||||
let result;
|
||||
try {
|
||||
@@ -388,6 +409,7 @@ export const VehicleProvider = ({ children }) => {
|
||||
totalFlashpackECUMappings,
|
||||
flashpackECUMappings,
|
||||
getFlashpackECUMappings,
|
||||
addFlashpackVersion,
|
||||
deleteFlashpackVersion,
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user