CEC-4100: Added push config changes to vin (#338)

This commit is contained in:
Alexander Andrews
2023-05-23 17:16:46 -04:00
committed by GitHub
parent 8e71cf6c8c
commit bf0fb5363b
12 changed files with 638 additions and 1683 deletions

View File

@@ -200,6 +200,20 @@ export const VehicleProvider = ({ children }) => {
}
};
const uploadConfig = async (vin, token) => {
try {
setBusy(true);
validateVIN(vin);
const result = await api.updateConfig(vin, token);
if (result.error)
throw new Error(`Update vehicle error. ${result.message}`);
return result;
} finally {
setBusy(false);
}
}
const deleteVehicle = async (vin, token) => {
try {
setBusy(true);
@@ -285,6 +299,7 @@ export const VehicleProvider = ({ children }) => {
updateVehicle,
getFleets,
getVersionLog,
uploadConfig
}}
>
{children}