-
Notifications
You must be signed in to change notification settings - Fork 517
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
Conversation
@@ -140,11 +141,20 @@ class ResourceBase(DispatchBase): | |||
|
|||
|
|||
class ContactBase(DispatchBase): | |||
email: EmailStr | |||
email: str |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]"?
There was a problem hiding this comment.
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).
We handle the invalid
EmailStr
by providing a custom validator inBaseContact
model, which will return a default value for invalid emails, instead of failing the entire request.We add searching by emails in
ParticipantSearchPopover