mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 01:06:44 +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 =>
|
||||
ProvidersController.currentServerProvider!.getPricePerGb();
|
||||
(await ProvidersController.currentServerProvider!.getPricePerGb()).data;
|
||||
|
||||
Future<void> refresh() async {
|
||||
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
|
||||
/// Probably we should scrap the doc page manually
|
||||
@override
|
||||
Future<Price?> getPricePerGb() async => Price(
|
||||
value: 0.10,
|
||||
currency: 'USD',
|
||||
Future<GenericResult<Price?>> getPricePerGb() async => GenericResult(
|
||||
success: true,
|
||||
data: Price(
|
||||
value: 0.10,
|
||||
currency: 'USD',
|
||||
),
|
||||
);
|
||||
|
||||
@override
|
||||
|
|
Loading…
Reference in a new issue