fix(paheko): case insensitive user names search

This commit is contained in:
Matthieu Bessat 2024-01-21 23:22:27 +01:00
parent 6ae274e810
commit 6913defcd9

View file

@ -118,7 +118,11 @@ pub async fn sync_paheko(
// check for existing user in paheko by email
// TODO: check user with fuzzing first name and last name
let existing_user_opt = existing_users
.iter().find(|user| user.first_name == answer.first_name && user.last_name == answer.last_name)
.iter()
.find(|user|
user.first_name.clone().map(|x| x.to_lowercase()) == answer.first_name.clone().map(|x| x.to_lowercase()) &&
user.last_name.to_lowercase() == answer.last_name.to_lowercase()
)
.cloned();
let pk_user_summary = match existing_user_opt.clone() {
Some(user) => {