🐛 Fix getFeed isn't using the ListPostV2

This commit is contained in:
LittleSheep 2025-04-01 00:14:12 +08:00
parent b5f42863ce
commit 5da7ccc8ef

View File

@ -33,11 +33,14 @@ class SnPostContentProvider {
}
Future<List<SnFeedEntry>> getFeed({int take = 20, DateTime? cursor}) async {
final resp =
await _sn.client.get('/cgi/co/recommendations/feed', queryParameters: {
'take': take,
if (cursor != null) 'cursor': cursor.toUtc().millisecondsSinceEpoch,
});
final resp = await _sn.client.get(
'/cgi/co/recommendations/feed',
queryParameters: {
'take': take,
if (cursor != null) 'cursor': cursor.toUtc().millisecondsSinceEpoch,
},
options: Options(headers: {'X-API-Version': '2'}),
);
final List<SnFeedEntry> out =
List.from(resp.data.map((ele) => SnFeedEntry.fromJson(ele)));