From 6913defcd9b8214e39c58e73ab24040383793f90 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Sun, 21 Jan 2024 23:22:27 +0100 Subject: [PATCH] fix(paheko): case insensitive user names search --- src/sync_paheko.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sync_paheko.rs b/src/sync_paheko.rs index 0f8b292..db52250 100644 --- a/src/sync_paheko.rs +++ b/src/sync_paheko.rs @@ -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) => {