mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-07 00:24:18 +00:00
Merge pull request 'fix(hetzner): Remove optional status enum for getVolumes of Hetzner' (#388) from hetzner-volume into master
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/pulls/388 Reviewed-by: Inex Code <inex.code@selfprivacy.org>
This commit is contained in:
commit
d4ff17201e
|
@ -360,21 +360,14 @@ class HetznerApi extends RestApiMap {
|
||||||
return GenericResult(success: true, data: pricing);
|
return GenericResult(success: true, data: pricing);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<GenericResult<List<HetznerVolume>>> getVolumes({
|
Future<GenericResult<List<HetznerVolume>>> getVolumes() async {
|
||||||
final String? status,
|
|
||||||
}) async {
|
|
||||||
final List<HetznerVolume> volumes = [];
|
final List<HetznerVolume> volumes = [];
|
||||||
|
|
||||||
Response? getVolumesResonse;
|
Response? getVolumesResponse;
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
getVolumesResonse = await client.get(
|
getVolumesResponse = await client.get('/volumes');
|
||||||
'/volumes',
|
for (final volume in getVolumesResponse.data['volumes']) {
|
||||||
queryParameters: {
|
|
||||||
'status': status,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
for (final volume in getVolumesResonse.data['volumes']) {
|
|
||||||
volumes.add(HetznerVolume.fromJson(volume));
|
volumes.add(HetznerVolume.fromJson(volume));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -391,8 +384,8 @@ class HetznerApi extends RestApiMap {
|
||||||
return GenericResult(
|
return GenericResult(
|
||||||
data: volumes,
|
data: volumes,
|
||||||
success: true,
|
success: true,
|
||||||
code: getVolumesResonse.statusCode,
|
code: getVolumesResponse.statusCode,
|
||||||
message: getVolumesResonse.statusMessage,
|
message: getVolumesResponse.statusMessage,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue