From 192be95f84058753d48ee9e872aac88db18e3816 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Tue, 14 Feb 2023 22:16:29 -0500 Subject: bug fixes --- src/api/posts.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/api/posts.rs') 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, ) -> 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, ) -> 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") }; -- cgit v1.2.3-freya