Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#IOPID-1885] SanitizeProfileEmail: check case insensitive #238

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SanitizeProfileEmail/__tests__/handler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe("Given a list a profiles to be sanitized with their duplicated e-mail a
// 3. should have an item in the profile collection
const profiles: ProfileToSanitize[] = [
{
email: mocks.email,
email: mocks.email.toUpperCase() as EmailString,
fiscalCode: mocks.fiscalCodes.TO_SANITIZE
},
{
Expand Down
3 changes: 2 additions & 1 deletion SanitizeProfileEmail/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ const getProfile = (fiscalCode: ProfileToSanitize["fiscalCode"]) => (
const isProfileEligibleForUpdate = (duplicatedEmail: EmailString) => (
profile: RetrievedProfile
): boolean =>
profile.isEmailValidated === true && profile.email === duplicatedEmail;
profile.isEmailValidated === true &&
profile.email?.toLowerCase() === duplicatedEmail.toLowerCase();

const getProfileForUpdate = (
profile: ProfileToSanitize
Expand Down
Loading