feat(labrinth): basic offset pagination for moderation reports and projects (#4063)
This commit is contained in:
committed by
GitHub
parent
6db1d66591
commit
358cf31c87
@@ -15,10 +15,10 @@ pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
#[derive(Deserialize)]
|
||||
pub struct ResultCount {
|
||||
#[serde(default = "default_count")]
|
||||
pub count: i16,
|
||||
pub count: u16,
|
||||
}
|
||||
|
||||
fn default_count() -> i16 {
|
||||
fn default_count() -> u16 {
|
||||
100
|
||||
}
|
||||
|
||||
@@ -34,7 +34,10 @@ pub async fn get_projects(
|
||||
req,
|
||||
pool.clone(),
|
||||
redis.clone(),
|
||||
web::Query(internal::moderation::ResultCount { count: count.count }),
|
||||
web::Query(internal::moderation::ProjectsRequestOptions {
|
||||
count: count.count,
|
||||
offset: 0,
|
||||
}),
|
||||
session_queue,
|
||||
)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user