From a25ae7addaea9ebeb4de9a5007a0564aa8f6a511 Mon Sep 17 00:00:00 2001 From: Bauke Date: Sat, 8 Oct 2022 22:10:28 +0200 Subject: [PATCH] Sort groups ascending by name. --- source/group_data/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/group_data/mod.rs b/source/group_data/mod.rs index cce5f09..28be0cc 100644 --- a/source/group_data/mod.rs +++ b/source/group_data/mod.rs @@ -19,7 +19,12 @@ impl GroupDataModel { db: &DatabaseConnection, snapshot: &SnapshotModel, ) -> Result> { - let groups = snapshot.find_related(GroupDataEntity).all(db).await?; + let groups = snapshot + .find_related(GroupDataEntity) + .order_by_asc(GroupDataColumn::Name) + .all(db) + .await?; + Ok(groups) }