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

Email Search in ParticipantSearchPopover, Participant hover card component #4152

Closed
wants to merge 9 commits into from

Conversation

wssheldon
Copy link
Contributor

We handle the invalid EmailStr by providing a custom validator in BaseContact model, which will return a default value for invalid emails, instead of failing the entire request.

We add searching by emails in ParticipantSearchPopover

@wssheldon wssheldon added enhancement New feature or request UI/UX labels Dec 19, 2023
@@ -140,11 +141,20 @@ class ResourceBase(DispatchBase):


class ContactBase(DispatchBase):
email: EmailStr
email: str
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevgliss figured u should see this change specifically

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did test this E2E by modifying an email to some junk value and it works as expected. I get the 422 before, and valid request + default value after this change.

Copy link
Contributor

@kevgliss kevgliss Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, this seems a bit counterintuitive to me? If I put in a bad email, I get a 200 and the email is "[email protected]"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed this is probably not ideal, it begs the question how we ended up with one in the first place. it might be hard to figure out at this point.

without knowing for sure how it ended up in the database, does it make sense to have a dedicated view and model specifically for read operations, to have the robustness in the event that one somehow slips by (otherwise the entire component stops working, when we really just want the bad value to get handled in some way).

@wssheldon wssheldon closed this Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants