Merge branch 'release/0.9.0'

This commit is contained in:
jwu-fisker
2023-06-21 20:24:18 -07:00
29 changed files with 614 additions and 58 deletions

View File

@@ -61,6 +61,22 @@ export const VehicleProvider = ({ children }) => {
}
};
const addTags = async (vins, tags, token) => {
try {
setBusy(true);
vins.forEach(vin => validateVIN(vin));
const validateTags = tags.every(tag => typeof tag === "string");
if (!validateTags)
throw new Error("Invalid Tag");
const result = await api.addTags(vins, tags, token)
if (result.error)
throw new Error(`Add tags error. ${result.message}`);
} finally {
setBusy(false)
}
}
const getConnections = async (vins, token) => {
try {
setBusy(true);
@@ -301,6 +317,7 @@ export const VehicleProvider = ({ children }) => {
getFleets,
getVersionLog,
uploadConfig,
addTags,
}}
>
{children}

View File

@@ -39,6 +39,7 @@ let vehicleState = {
battery: {
total_mileage_odometer: 12000,
percent: 95,
battery_voltage: 12.5,
},
max_range: {
max_miles: 577,