CEC-1772 Use Node 16 for Github actions (#160)

* CEC-1772 Use Node 16 for Github actions

* Update package-lock.json
This commit is contained in:
John Wu
2022-05-27 11:15:37 -07:00
committed by GitHub
parent b3b792fef4
commit d9cbf9ef23
6 changed files with 17463 additions and 129 deletions

View File

@@ -127,12 +127,12 @@ export const VehicleProvider = ({ children }) => {
const result = await api.getVehicle(vin, token);
if (result.error) throw new Error(`Get vehicle error. ${result.message}`);
setVehicle(result);
setVehicle(result ?? []);
return result;
} finally {
setBusy(false);
}
}
};
const getVehicles = async (search, token) => {
try {
@@ -143,7 +143,7 @@ export const VehicleProvider = ({ children }) => {
throw new Error(`Get vehicles error. ${result.message}`);
}
await addConnections(result.data, token);
setVehicles(result.data);
setVehicles(result.data ?? []);
if (result.total) {
setTotalVehicles(result.total);
}
@@ -188,7 +188,7 @@ export const VehicleProvider = ({ children }) => {
} finally {
setBusy(false);
}
}
};
const deleteVehicle = async (vin, token) => {
try {
@@ -202,7 +202,7 @@ export const VehicleProvider = ({ children }) => {
} finally {
setBusy(false);
}
}
};
return (
<VehicleContext.Provider
@@ -224,7 +224,7 @@ export const VehicleProvider = ({ children }) => {
getVehicle,
getVehicles,
sendCommand,
updateVehicle
updateVehicle,
}}
>
{children}
@@ -246,5 +246,4 @@ const validateVIN = (vin) => {
}
};
export const useVehicleContext = () => useContext(VehicleContext);