♻️ Better categorized fetching in publisher page

This commit is contained in:
2024-12-01 23:20:05 +08:00
parent 177ff513ee
commit 9588fc0475
2 changed files with 286 additions and 307 deletions

View File

@ -66,11 +66,13 @@ class SnPostContentProvider {
Future<(List<SnPost>, int)> listPosts({
int take = 10,
int offset = 0,
String? type,
String? author,
}) async {
final resp = await _sn.client.get('/cgi/co/posts', queryParameters: {
'take': take,
'offset': offset,
if (type != null) 'type': type,
if (author != null) 'author': author,
});
final List<SnPost> out = await _preloadRelatedDataInBatch(