-
Notifications
You must be signed in to change notification settings - Fork 55
fix: make source optional #819
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
Conversation
.string() | ||
.allow(null) | ||
.default(INVITE_SOURCE.WORK_MANAGER) | ||
.custom((value) => { |
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.
The custom function here is converting null
to undefined
. Consider explaining why this conversion is necessary, as it might affect how the source
field is handled downstream. Ensure that this change aligns with the intended behavior of making the source
optional.
source: Joi.string() | ||
source: Joi | ||
.string() | ||
.valid(_.values(INVITE_STATUS)) |
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.
The valid
method is being used with INVITE_STATUS
, but it seems like it should be used with INVITE_SOURCE
instead, as source
is expected to be a string representing the invite source. Please verify if this is the intended behavior.
source: Joi.string() | ||
source: Joi | ||
.string() | ||
.valid(_.values(INVITE_SOURCE)) |
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.
The change from INVITE_STATUS
to INVITE_SOURCE
seems to align with the pull request description of making the source field optional. However, ensure that INVITE_SOURCE
is correctly defined and imported in this context, and that it contains the appropriate values for validation.
What's in this PR?