fix(digital-ocean): Fix response code checking on volume actions

We can't compare with 'compelted' because Digital Ocean responses with 'in progress' right away or something, so it's better to check if it's just not 'error'
routes-refactor
NaiJi ✨ 2022-11-04 16:05:40 +04:00
parent edc171efd7
commit aa1c04fdb8
1 changed files with 2 additions and 4 deletions

View File

@ -241,8 +241,7 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
'region': region,
},
);
success =
dbPostResponse.data['action']['status'].toString() == 'completed';
success = dbPostResponse.data['action']['status'].toString() != 'error';
} catch (e) {
print(e);
} finally {
@ -268,8 +267,7 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
'region': region,
},
);
success =
dbPostResponse.data['action']['status'].toString() == 'completed';
success = dbPostResponse.data['action']['status'].toString() != 'error';
} catch (e) {
print(e);
} finally {