From 642ab43fa681e910ceba3cabdec851f41972f05b Mon Sep 17 00:00:00 2001 From: linuskendall Date: Sun, 16 Jul 2023 15:20:52 +0100 Subject: [PATCH] Order by creator position --- digital_asset_types/src/dao/scopes/asset.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/digital_asset_types/src/dao/scopes/asset.rs b/digital_asset_types/src/dao/scopes/asset.rs index 46bd57d1..070e7d9f 100644 --- a/digital_asset_types/src/dao/scopes/asset.rs +++ b/digital_asset_types/src/dao/scopes/asset.rs @@ -218,6 +218,7 @@ pub async fn get_related_for_assets( let creators = asset_creators::Entity::find() .filter(asset_creators::Column::AssetId.is_in(ids.clone())) .order_by_asc(asset_creators::Column::AssetId) + .order_by_asc(asset_creators::Column::Position) .all(conn) .await?; for c in creators.into_iter() { @@ -286,6 +287,7 @@ pub async fn get_by_id( .await?; let creators: Vec = asset_creators::Entity::find() .filter(asset_creators::Column::AssetId.eq(asset.id.clone())) + .order_by(asset_creators::Column::Position, Order::Asc) .all(conn) .await?; let grouping: Vec = asset_grouping::Entity::find()