Merge branch 'release/0.9.0'
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -39,6 +39,7 @@ let vehicleState = {
|
||||
battery: {
|
||||
total_mileage_odometer: 12000,
|
||||
percent: 95,
|
||||
battery_voltage: 12.5,
|
||||
},
|
||||
max_range: {
|
||||
max_miles: 577,
|
||||
|
||||
Reference in New Issue
Block a user