subscription list+view
Some checks failed
Build Docker and Deploy / Build Docker Container (push) Successful in 1m8s
Build Docker and Deploy / Run Unit-Tests (push) Failing after 11m19s
Build Docker and Deploy / Deploy to Server (push) Has been skipped

This commit is contained in:
2025-04-18 01:45:56 +02:00
parent 63bc71c405
commit 24cd1692c6
14 changed files with 750 additions and 23 deletions

View File

@@ -332,11 +332,26 @@ class APIClient {
);
}
static Future<Subscription> getSubscription(TokenSource auth, String subscriptionID) async {
return await _request(
name: 'getSubscription',
method: 'GET',
relURL: 'users/${auth.getUserID()}/subscriptions/${subscriptionID}',
fn: Subscription.fromJson,
authToken: auth.getToken(),
);
}
static Future<List<Subscription>> getSubscriptionList(TokenSource auth) async {
return await _request(
name: 'getSubscriptionList',
method: 'GET',
relURL: 'users/${auth.getUserID()}/subscriptions',
query: {
'direction': ['both'],
'confirmation': ['all'],
'external': ['all'],
},
fn: (json) => Subscription.fromJsonArray(json['subscriptions'] as List<dynamic>),
authToken: auth.getToken(),
);