Skip to content

Commit

Permalink
Merge pull request #169 from cspr-rad/fix-167
Browse files Browse the repository at this point in the history
kairos-data: query case-insensitive sender/recipient. fixes #167
  • Loading branch information
marijanp authored Jul 26, 2024
2 parents c274bd9 + c215ead commit 92a16ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kairos-data/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub async fn get(
let mut query = transactions::table.into_boxed::<diesel::pg::Pg>();

if let Some(sender) = filter.sender {
query = query.filter(transactions::public_key.eq(sender));
query = query.filter(transactions::public_key.eq(sender.to_lowercase()));
}
if let Some(min_timestamp) = filter.min_timestamp {
query = query.filter(transactions::timestamp.ge(min_timestamp));
Expand All @@ -66,7 +66,7 @@ pub async fn get(
query = query.filter(transactions::amount.le(BigDecimal::from(max_amount)));
}
if let Some(recipient) = filter.recipient {
query = query.filter(transactions::recipient.eq(recipient));
query = query.filter(transactions::recipient.eq(recipient.to_lowercase()));
}
if let Some(transaction_type) = filter.transaction_type {
query = query.filter(transactions::trx.eq(transaction_type));
Expand Down

0 comments on commit 92a16ed

Please sign in to comment.