mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-03-11 17:24:09 +00:00
fix(hetzner): Fix endpoints urls
Incorrect dereferencing in strings
This commit is contained in:
parent
92b417a103
commit
2a5fceae91
1 changed files with 6 additions and 4 deletions
|
@ -234,7 +234,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
Future<void> deleteVolume(final ServerVolume volume) async {
|
Future<void> deleteVolume(final ServerVolume volume) async {
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
await client.delete('/volumes/$volume.id');
|
await client.delete('/volumes/${volume.id}');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -253,7 +253,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
dbPostResponse = await client.post(
|
dbPostResponse = await client.post(
|
||||||
'/volumes/$volume.id/actions/attach',
|
'/volumes/${volume.id}/actions/attach',
|
||||||
data: {
|
data: {
|
||||||
'automount': true,
|
'automount': true,
|
||||||
'server': serverId,
|
'server': serverId,
|
||||||
|
@ -276,7 +276,9 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
final Response dbPostResponse;
|
final Response dbPostResponse;
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
dbPostResponse = await client.post('/volumes/$volume.id/actions/detach');
|
dbPostResponse = await client.post(
|
||||||
|
'/volumes/${volume.id}/actions/detach',
|
||||||
|
);
|
||||||
success = dbPostResponse.data['action']['status'].toString() != 'error';
|
success = dbPostResponse.data['action']['status'].toString() != 'error';
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
|
@ -298,7 +300,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
dbPostResponse = await client.post(
|
dbPostResponse = await client.post(
|
||||||
'/volumes/$volume.id/actions/resize',
|
'/volumes/${volume.id}/actions/resize',
|
||||||
data: {
|
data: {
|
||||||
'size': size.gibibyte,
|
'size': size.gibibyte,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue