mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 17:26:35 +00:00
feat: Implement domain list getter for digital ocean dns
This commit is contained in:
parent
a45b93cd27
commit
fc4f78162b
|
@ -238,16 +238,13 @@ class DigitalOceanDnsApi extends DnsProviderApi {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> domainList() async {
|
Future<List<String>> domainList() async {
|
||||||
final String url = '$rootAddress/zones';
|
final String url = '$rootAddress/domains';
|
||||||
List<String> domains = [];
|
List<String> domains = [];
|
||||||
|
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
final Response response = await client.get(
|
final Response response = await client.get(url);
|
||||||
url,
|
domains = response.data['domains']
|
||||||
queryParameters: {'per_page': 50},
|
|
||||||
);
|
|
||||||
domains = response.data['result']
|
|
||||||
.map<String>((final el) => el['name'] as String)
|
.map<String>((final el) => el['name'] as String)
|
||||||
.toList();
|
.toList();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in a new issue