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, amount: u64,
name: &str, name: &str,
) -> Result<Vec<Self>> { ) -> Result<Vec<Self>> {
let groups = GroupDataEntity::find() let mut groups = GroupDataEntity::find()
.order_by_asc(GroupDataColumn::SnapshotId) .order_by_desc(GroupDataColumn::SnapshotId)
.filter(GroupDataColumn::Name.eq(name)) .filter(GroupDataColumn::Name.eq(name))
.limit(amount) .limit(amount)
.all(db) .all(db)
.await?; .await?;
groups.reverse();
Ok(groups) Ok(groups)
} }