* add deploy button * disable control if inactive * add cases (cherry picked from commit 91b2a8c8aab546221db8da8eaed22bca78c4d91f) Co-authored-by: Tristan Timblin <ttimblin@fiskerinc.com>
This commit is contained in:
@@ -55,6 +55,21 @@ export const CarUpdatesProvider = ({ children }) => {
|
||||
return result;
|
||||
};
|
||||
|
||||
const deployUpdate = async (id, token) => {
|
||||
let result;
|
||||
|
||||
try {
|
||||
setBusy(true);
|
||||
result = await api.deployCarUpdate(id, token);
|
||||
if (result.error)
|
||||
throw new Error(`Cancel car update error. ${result.message}`);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
const deployCarUpdates = async (data, token) => {
|
||||
let result;
|
||||
|
||||
@@ -295,6 +310,7 @@ export const CarUpdatesProvider = ({ children }) => {
|
||||
totalCarUpdates,
|
||||
versions,
|
||||
cancelUpdate,
|
||||
deployUpdate,
|
||||
deployCarUpdates,
|
||||
deployFleetUpdates,
|
||||
getCarUpdates,
|
||||
|
||||
Reference in New Issue
Block a user