sort by nb of contrib
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending

This commit is contained in:
Mylloon 2023-04-14 12:00:16 +02:00
parent c934d5f42e
commit 274a6d567b
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -85,13 +85,21 @@ pub async fn get_page(config: Config) -> String {
d.name = name.into_iter().collect();
});
// Ascending order
// Ascending order by pulls IDs
data.iter_mut().for_each(|d| {
d.pulls_closed.reverse();
d.pulls_merged.reverse();
d.pulls_open.reverse();
});
// Ascending order by number of pulls
data.sort_by(|a, b| {
b.pulls_merged
.len()
.partial_cmp(&a.pulls_merged.len())
.unwrap()
});
PortfolioTemplate {
error: false,
projects: Some(