Switch sort order again and then reverse the found results.

This commit is contained in:
Bauke 2022-10-09 00:02:25 +02:00
parent e21ef0fa87
commit de5d256c96
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 3 additions and 2 deletions

View File

@ -48,12 +48,13 @@ impl GroupDataModel {
amount: u64,
name: &str,
) -> Result<Vec<Self>> {
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)
}