working, just need to prettify

This commit is contained in:
padamsen_fisker
2024-01-15 17:15:09 -05:00
parent e85f55d36d
commit 421a8480dd
3 changed files with 239 additions and 2 deletions

View File

@@ -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,
}}
>