Skip to content

Commit

Permalink
fix: use user-provided sort direction (metaplex-foundation#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
tahsintunan authored Jun 30, 2023
1 parent 550874c commit cd8348b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions digital_asset_types/src/dao/scopes/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ where
let mut stmt = asset::Entity::find()
.filter(condition)
.join(JoinType::LeftJoin, relation.def())
.order_by(sort_by, sort_direction)
.order_by(asset::Column::Id, Order::Asc);
.order_by(sort_by, sort_direction.clone())
.order_by(asset::Column::Id, sort_direction);

stmt = paginate(pagination, limit, stmt);
let assets = stmt.all(conn).await?;
Expand Down Expand Up @@ -253,8 +253,8 @@ pub async fn get_assets_by_condition(
}
stmt = stmt
.filter(condition)
.order_by(sort_by, sort_direction)
.order_by(asset::Column::Id, Order::Asc);
.order_by(sort_by, sort_direction.clone())
.order_by(asset::Column::Id, sort_direction);

stmt = paginate(pagination, limit, stmt);
let assets = stmt.all(conn).await?;
Expand Down

0 comments on commit cd8348b

Please sign in to comment.