View posts posted by friends

This commit is contained in:
2024-08-19 00:33:03 +08:00
parent b63db7fe76
commit 80bade0e03
6 changed files with 58 additions and 18 deletions

View File

@@ -10,12 +10,19 @@ class PostProvider extends GetConnect {
Future<Response> listRecommendations(int page,
{String? realm, String? channel}) async {
GetConnect client;
final AuthProvider auth = Get.find();
final queries = [
'take=${10}',
'offset=$page',
if (realm != null) 'realm=$realm',
];
final resp = await get(
if (auth.isAuthorized.value) {
client = auth.configureClient('co');
} else {
client = ServiceFinder.configureClient('co');
}
final resp = await client.get(
channel == null
? '/recommendations?${queries.join('&')}'
: '/recommendations/$channel?${queries.join('&')}',