mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-04 23:24:20 +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);
|
||||
}
|
||||
|
||||
Future<GenericResult<List<HetznerVolume>>> getVolumes({
|
||||
final String? status,
|
||||
}) async {
|
||||
Future<GenericResult<List<HetznerVolume>>> getVolumes() async {
|
||||
final List<HetznerVolume> volumes = [];
|
||||
|
||||
Response? getVolumesResonse;
|
||||
Response? getVolumesResponse;
|
||||
final Dio client = await getClient();
|
||||
try {
|
||||
getVolumesResonse = await client.get(
|
||||
'/volumes',
|
||||
queryParameters: {
|
||||
'status': status,
|
||||
},
|
||||
);
|
||||
for (final volume in getVolumesResonse.data['volumes']) {
|
||||
getVolumesResponse = await client.get('/volumes');
|
||||
for (final volume in getVolumesResponse.data['volumes']) {
|
||||
volumes.add(HetznerVolume.fromJson(volume));
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -391,8 +384,8 @@ class HetznerApi extends RestApiMap {
|
|||
return GenericResult(
|
||||
data: volumes,
|
||||
success: true,
|
||||
code: getVolumesResonse.statusCode,
|
||||
message: getVolumesResonse.statusMessage,
|
||||
code: getVolumesResponse.statusCode,
|
||||
message: getVolumesResponse.statusMessage,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue