Skip to content

Commit

Permalink
Fix svm lost bid query update (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
danimhr authored Nov 1, 2024
1 parent 0bd47e3 commit 67296fd
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions auction-server/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,11 +885,12 @@ impl BidStatusTrait for BidStatusSvm {
},
BidStatusSvm::Lost { .. } => match auction {
Some(auction) => Ok(sqlx::query!(
"UPDATE bid SET status = $1, auction_id = $2 WHERE id = $3 AND status = $4",
"UPDATE bid SET status = $1, auction_id = $2 WHERE id = $3 AND status IN ($4, $5)",
models::BidStatus::Lost as _,
auction.id,
id,
models::BidStatus::Pending as _
models::BidStatus::Pending as _,
models::BidStatus::Submitted as _,
)),
None => Ok(sqlx::query!(
"UPDATE bid SET status = $1 WHERE id = $2 AND status = $3",
Expand Down

0 comments on commit 67296fd

Please sign in to comment.