From de5d256c9622af173b5c316478112338ec1e8483 Mon Sep 17 00:00:00 2001 From: Bauke Date: Sun, 9 Oct 2022 00:02:25 +0200 Subject: [PATCH] Switch sort order again and then reverse the found results. --- source/group_data/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/group_data/mod.rs b/source/group_data/mod.rs index 28be0cc..4ef31f0 100644 --- a/source/group_data/mod.rs +++ b/source/group_data/mod.rs @@ -48,12 +48,13 @@ impl GroupDataModel { amount: u64, name: &str, ) -> Result> { - let groups = GroupDataEntity::find() - .order_by_asc(GroupDataColumn::SnapshotId) + let mut groups = GroupDataEntity::find() + .order_by_desc(GroupDataColumn::SnapshotId) .filter(GroupDataColumn::Name.eq(name)) .limit(amount) .all(db) .await?; + groups.reverse(); Ok(groups) }