Conversation
|
|
||
| await updateMembersWithTraitsAndSkills(traitUpdate) | ||
| updated += 1 | ||
| const updatedSuccessfully = await updateMembersWithTraitsAndSkills(traitUpdate) |
There was a problem hiding this comment.
[❗❗ correctness]
The function updateMembersWithTraitsAndSkills is expected to return a boolean indicating success. Ensure that this function consistently returns a boolean in all cases to avoid potential logical errors.
Tweak for specific traits
| _.forEach(ret, r => { | ||
| r.createdAt = r.createdAt ? r.createdAt.getTime() : null | ||
| r.updatedAt = r.updatedAt ? r.updatedAt.getTime() : null | ||
| r.createdBy = helper.bigIntToNumber(r.createdBy) |
There was a problem hiding this comment.
[correctness]
Ensure that helper.bigIntToNumber handles cases where createdBy might be null or undefined. If createdBy is expected to always be a BigInt, consider adding validation earlier in the process to enforce this assumption.
| r.createdAt = r.createdAt ? r.createdAt.getTime() : null | ||
| r.updatedAt = r.updatedAt ? r.updatedAt.getTime() : null | ||
| r.createdBy = helper.bigIntToNumber(r.createdBy) | ||
| r.updatedBy = helper.bigIntToNumber(r.updatedBy) |
There was a problem hiding this comment.
[correctness]
Similar to createdBy, verify that helper.bigIntToNumber correctly handles updatedBy when it is null or undefined. Consider adding validation to ensure updatedBy is always a BigInt if that is the assumption.
No description provided.