-
Notifications
You must be signed in to change notification settings - Fork 5
Hotfix - Email fix for PS-455 #21
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
| expect(memberUpdateMock).toHaveBeenCalledWith({ | ||
| where: { userId }, | ||
| expect(memberUpdateManyMock).toHaveBeenCalledWith({ | ||
| where: { userId: BigInt(userId) }, |
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 BigInt for userId in the where clause is inconsistent with other parts of the code where userId is used as a number. Ensure that the data type is consistent across the application to avoid potential type-related issues.
| expect(memberUpdateMock).toHaveBeenCalledWith({ | ||
| where: { userId }, | ||
| expect(memberUpdateManyMock).toHaveBeenCalledWith({ | ||
| where: { userId: BigInt(userId) }, |
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 BigInt for userId in the where clause is inconsistent with other parts of the code where userId is used as a number. Ensure that the data type is consistent across the application to avoid potential type-related issues.
| } | ||
|
|
||
| if (emailChanged) { | ||
| const memberUserId = BigInt(userId); |
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 conversion of userId to BigInt is necessary for the where clause in the memberPrisma.member.update method. Ensure that userId is always a valid number that can be safely converted to BigInt to avoid runtime errors.
| await this.memberPrisma.member.update({ | ||
| where: { userId }, | ||
| const updateResult = await this.memberPrisma.member.update({ | ||
| where: { userId: memberUserId }, |
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]
Consider adding error handling for the updateResult to ensure that the update operation was successful. This can help in diagnosing issues if the update fails silently.
No description provided.