Realm posts

This commit is contained in:
2025-02-22 13:13:38 +08:00
parent 671b857a79
commit edd86eda77
3 changed files with 157 additions and 37 deletions

View File

@ -126,6 +126,7 @@ class SnPostContentProvider {
String? author,
Iterable<String>? categories,
Iterable<String>? tags,
String? realm,
}) async {
final resp = await _sn.client.get('/cgi/co/posts', queryParameters: {
'take': take,
@ -134,6 +135,7 @@ class SnPostContentProvider {
if (author != null) 'author': author,
if (tags?.isNotEmpty ?? false) 'tags': tags!.join(','),
if (categories?.isNotEmpty ?? false) 'categories': categories!.join(','),
if (realm != null) 'realm': realm,
});
final List<SnPost> out = await _preloadRelatedDataInBatch(
List.from(resp.data['data']?.map((e) => SnPost.fromJson(e)) ?? []),