summaryrefslogtreecommitdiff
path: root/src/api/posts.rs
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2023-02-02 11:29:37 -0500
committerTyler Murphy <tylermurphy534@gmail.com>2023-02-02 11:29:37 -0500
commit18a27f62befb0c0d2e3b175f08f6088f10b25063 (patch)
tree1d8c0d00685f9374fdb3705062c08265d7e1fdb0 /src/api/posts.rs
parentadd caching header (diff)
downloadxssbook-18a27f62befb0c0d2e3b175f08f6088f10b25063.tar.gz
xssbook-18a27f62befb0c0d2e3b175f08f6088f10b25063.tar.bz2
xssbook-18a27f62befb0c0d2e3b175f08f6088f10b25063.zip
loading by offset on profile
Diffstat (limited to 'src/api/posts.rs')
-rw-r--r--src/api/posts.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/posts.rs b/src/api/posts.rs
index 3a2e507..d85fb98 100644
--- a/src/api/posts.rs
+++ b/src/api/posts.rs
@@ -72,6 +72,7 @@ async fn page(
#[derive(Deserialize)]
struct UsersPostsRequest {
user_id: u64,
+ page: u64
}
impl Check for UsersPostsRequest {
@@ -84,7 +85,7 @@ async fn user(
AuthorizedUser(_user): AuthorizedUser,
Json(body): Json<UsersPostsRequest>,
) -> Response {
- let Ok(posts) = Post::from_user_id(body.user_id) else {
+ let Ok(posts) = Post::from_user_post_page(body.user_id, body.page) else {
return ResponseCode::InternalServerError.text("Failed to fetch posts")
};