Skip to content

Commit

Permalink
Merge pull request #253 from holaplex/abdul/add-orderby
Browse files Browse the repository at this point in the history
Order by random() for selecting random queued mint
  • Loading branch information
imabdulbasit authored Oct 11, 2023
2 parents 165e9c1 + 27158ca commit 69246eb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/src/mutations/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,7 @@ impl Mutation {
let mint = CollectionMints::find()
.filter(collection_mints::Column::CollectionId.eq(drop.collection_id))
.filter(collection_mints::Column::CreationStatus.eq(CreationStatus::Queued))
.order_by(SimpleExpr::FunctionCall(Func::random()), Order::Asc)
.one(conn)
.await?
.ok_or(Error::new("No Queued mint found for the drop"))?;
Expand Down

0 comments on commit 69246eb

Please sign in to comment.