Switch sort order again and then reverse the found results.
This commit is contained in:
		
							parent
							
								
									e21ef0fa87
								
							
						
					
					
						commit
						de5d256c96
					
				| 
						 | 
					@ -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)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in New Issue