summaryrefslogtreecommitdiff
path: root/src/api/posts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/posts.rs')
-rw-r--r--src/api/posts.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/posts.rs b/src/api/posts.rs
index ee590ec..57b2ca8 100644
--- a/src/api/posts.rs
+++ b/src/api/posts.rs
@@ -100,10 +100,10 @@ impl Check for PostPageRequest {
}
async fn page(
- AuthorizedUser(_user): AuthorizedUser,
+ AuthorizedUser(user): AuthorizedUser,
Json(body): Json<PostPageRequest>,
) -> Response {
- let Ok(posts) = Post::from_post_page(body.page) else {
+ let Ok(posts) = Post::from_post_page(user.user_id, body.page) else {
return ResponseCode::InternalServerError.text("Failed to fetch posts")
};
@@ -196,10 +196,10 @@ impl Check for UsersPostsRequest {
}
async fn user(
- AuthorizedUser(_user): AuthorizedUser,
+ AuthorizedUser(user): AuthorizedUser,
Json(body): Json<UsersPostsRequest>,
) -> Response {
- let Ok(posts) = Post::from_user_post_page(body.user_id, body.page) else {
+ let Ok(posts) = Post::from_user_post_page(user.user_id, body.user_id, body.page) else {
return ResponseCode::InternalServerError.text("Failed to fetch posts")
};