1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Can load older posts on user page

This commit is contained in:
2020-04-16 09:17:10 +02:00
parent c7502e6a04
commit 302e5f22ce
2 changed files with 29 additions and 14 deletions

View File

@ -67,10 +67,9 @@ class PostsHelper {
/// Get the list of posts of a user
Future<PostsList> getUserPosts(int userID, {int from = 0}) async {
final response = await APIRequest(
uri: "posts/get_user",
needLogin: true,
args: {"userID": userID.toString(), "startFrom": from.toString()})
final response = await (APIRequest(uri: "posts/get_user", needLogin: true)
..addInt("userID", userID)
..addInt("startFrom", from == 0 ? 0 : from - 1))
.exec();
if (response.code != 200) return null;