further improvements
This commit is contained in:
@@ -309,6 +309,26 @@ export const VehicleProvider = ({ children }) => {
|
||||
return result;
|
||||
};
|
||||
|
||||
const getFlashpackECUMappings = async (flashpack, model, year, options, token) => {
|
||||
let result;
|
||||
try {
|
||||
setBusy(true);
|
||||
|
||||
result = await api.getAllFlashpacks(options, token);
|
||||
if (result.error)
|
||||
throw new Error(`Get all flashpacks error. ${result.message}`);
|
||||
|
||||
setFlashpacks(result.data);
|
||||
if (options && options.offset === 0 && result.total) {
|
||||
setTotalFlashpacks(result.total);
|
||||
}
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
return (
|
||||
<VehicleContext.Provider
|
||||
value={{
|
||||
@@ -341,7 +361,7 @@ export const VehicleProvider = ({ children }) => {
|
||||
flashpacks,
|
||||
totalFlashpacks,
|
||||
getAllFlashpacks,
|
||||
// getFlashpackECUMappings,
|
||||
getFlashpackECUMappings,
|
||||
// addFlashpackECUMapping,
|
||||
// deleteFlashpackECUMapping,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user