diff options
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/mod.rs | 2 | ||||
-rw-r--r-- | src/api/posts.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/api/mod.rs b/src/api/mod.rs index 9efcefc..925aa4a 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -16,7 +16,7 @@ pub use auth::RegistrationRequet; pub fn router() -> Router { let governor_conf = Box::new( GovernorConfigBuilder::default() - .burst_size(10) + .burst_size(1000) .per_second(1) .key_extractor(SmartIpKeyExtractor) .finish() 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") }; |