Skip to content

Commit

Permalink
query lowwercase only!
Browse files Browse the repository at this point in the history
  • Loading branch information
vazw committed Jun 8, 2024
1 parent 288ad4d commit c47a877
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ impl From<UsersData> for NostrUser {
}

pub async fn get_username(db: web::Data<Pool<Sqlite>>, name: &str) -> Option<UsersData> {
let query = format!("SELECT * FROM users WHERE name='{name}'");
let l_name = name.to_lowercase();
let query = format!("SELECT * FROM users WHERE name='{l_name}'");
match sqlx::query_as::<_, UsersData>(&query)
.fetch_one(&**db.clone())
.await
Expand Down

0 comments on commit c47a877

Please sign in to comment.