mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
http: Use pinned repo length for per_page unwrap instead of fixed number
This allows us to avoid querying the repo stats and relying on maybe bad routing tables and take the hardcoded pinned repo array in case of querying for pinned repos.
This commit is contained in:
@@ -64,7 +64,10 @@ async fn project_root_handler(
|
||||
per_page,
|
||||
} = qs;
|
||||
let page = page.unwrap_or(0);
|
||||
let per_page = per_page.unwrap_or(10);
|
||||
let per_page = per_page.unwrap_or_else(|| match show {
|
||||
ProjectQuery::Pinned => ctx.profile.config.web.pinned.repositories.len(),
|
||||
_ => 10,
|
||||
});
|
||||
let storage = &ctx.profile.storage;
|
||||
let db = &ctx.profile.database()?;
|
||||
let pinned = &ctx.profile.config.web.pinned;
|
||||
|
||||
Reference in New Issue
Block a user