mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 09:16:54 +00:00
chore: Implement better Price abstraction for Digital Ocean server provider
This commit is contained in:
parent
49fe40bb38
commit
fa4939d7c6
|
@ -27,7 +27,7 @@ class ApiProviderVolumeCubit
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Price?> getPricePerGb() async =>
|
Future<Price?> getPricePerGb() async =>
|
||||||
ProvidersController.currentServerProvider!.getPricePerGb();
|
(await ProvidersController.currentServerProvider!.getPricePerGb()).data;
|
||||||
|
|
||||||
Future<void> refresh() async {
|
Future<void> refresh() async {
|
||||||
emit(const ApiProviderVolumeState([], LoadingStatus.refreshing, false));
|
emit(const ApiProviderVolumeState([], LoadingStatus.refreshing, false));
|
||||||
|
|
|
@ -779,9 +779,12 @@ class DigitalOceanServerProvider extends ServerProvider {
|
||||||
/// Hardcoded on their documentation and there is no pricing API at all
|
/// Hardcoded on their documentation and there is no pricing API at all
|
||||||
/// Probably we should scrap the doc page manually
|
/// Probably we should scrap the doc page manually
|
||||||
@override
|
@override
|
||||||
Future<Price?> getPricePerGb() async => Price(
|
Future<GenericResult<Price?>> getPricePerGb() async => GenericResult(
|
||||||
|
success: true,
|
||||||
|
data: Price(
|
||||||
value: 0.10,
|
value: 0.10,
|
||||||
currency: 'USD',
|
currency: 'USD',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Reference in a new issue