-
Notifications
You must be signed in to change notification settings - Fork 21
PM-3532 Update redux on open to work step #1460
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
|
|
||
| try { | ||
| await Promise.all([ | ||
| const [, updatedTraits] = await Promise.all([ |
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.
[💡 readability]
The use of array destructuring with const [, updatedTraits] can be confusing. Consider naming the first element explicitly if it's not needed, or use a more descriptive variable name for updatedTraits to clarify its purpose.
| ]) | ||
|
|
||
| const personalizationTrait = updatedTraits?.find( | ||
| (t: any) => t.traitId === UserTraitIds.personalization, |
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.
[maintainability]
The type any is used for t in the find method. Consider defining a specific type for t to enhance type safety and code clarity.
| availability, | ||
| preferredRoles, | ||
| }, | ||
| openToWork: openToWork |
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.
[correctness]
The use of _.omitBy with _.isUndefined is a good approach to remove undefined values, but ensure that openToWork is always an object or undefined. If openToWork can be null or another falsy value, this could lead to unexpected behavior.
Related JIRA Ticket:
https://topcoder.atlassian.net/browse/PM-3688
What's in this PR?