summaryrefslogtreecommitdiff
path: root/src/api/posts.rs
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2023-02-14 22:16:29 -0500
committerTyler Murphy <tylermurphy534@gmail.com>2023-02-14 22:16:29 -0500
commit192be95f84058753d48ee9e872aac88db18e3816 (patch)
tree497b687670c21653b94dc558c5a522c358b28057 /src/api/posts.rs
parentfriends (diff)
downloadxssbook-192be95f84058753d48ee9e872aac88db18e3816.tar.gz
xssbook-192be95f84058753d48ee9e872aac88db18e3816.tar.bz2
xssbook-192be95f84058753d48ee9e872aac88db18e3816.zip
bug fixes
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")
};