CEC-4517 reset TBOX remote command (#369)

* CEC-4517 Diagnostic Commands tab

* snapshot
This commit is contained in:
Eduard Voronkin
2023-06-23 12:38:09 -07:00
committed by GitHub
parent 3d4a07d8d8
commit fc7c1ea514
7 changed files with 236 additions and 3 deletions

View File

@@ -71,7 +71,7 @@ export const VehicleProvider = ({ children }) => {
const result = await api.addTags(vins, tags, token)
if (result.error)
throw new Error(`Add tags error. ${result.message}`);
throw new Error(`Add tags error. ${result.message}`);
} finally {
setBusy(false)
}
@@ -202,6 +202,18 @@ export const VehicleProvider = ({ children }) => {
}
};
const sendDiagnosticCommand = async (vins, command, token) => {
try {
setBusy(true);
const result = await api.sendDiagnosticCommand(vins, command, token);
if (result.error)
throw new Error(`Send diagnostic command error. ${result.message}`);
return result;
} finally {
setBusy(false);
}
};
const updateVehicle = async (vin, v, token) => {
try {
setBusy(true);
@@ -313,6 +325,7 @@ export const VehicleProvider = ({ children }) => {
getVehicle,
getVehicles,
sendCommand,
sendDiagnosticCommand,
updateVehicle,
getFleets,
getVersionLog,