Skip to content
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

UserUpdate email already exists error fix #1385

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

nitishkumar333
Copy link
Contributor

What kind of change does this PR introduce?
Bugfix

Fixes #1382

Did you add tests for your changes?
Yes

Summary
Added a condition that will check if the user changed the email or not. If the email is changed then only it will check if the email already exists or not. Also changed "find" to "findOne" as we know only one user will have a email and it is faster. Unit test is also added.

Have you read the contributing guide?
Yes

@github-actions
Copy link

github-actions bot commented Sep 8, 2023

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold
  3. Merge conflicts

The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.

Reviewers

When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

@nitishkumar333
Copy link
Contributor Author

@palisadoes added the test also in this PR, by mistake I closed the previous PR so had to open this one.

@codecov
Copy link

codecov bot commented Sep 10, 2023

Codecov Report

Merging #1385 (a36a507) into develop (c0468a4) will increase coverage by 0.06%.
Report is 7 commits behind head on develop.
The diff coverage is 99.69%.

@@             Coverage Diff             @@
##           develop    #1385      +/-   ##
===========================================
+ Coverage    98.17%   98.24%   +0.06%     
===========================================
  Files          184      184              
  Lines        10767    11295     +528     
  Branches       835      874      +39     
===========================================
+ Hits         10571    11097     +526     
- Misses         186      188       +2     
  Partials        10       10              
Files Changed Coverage Δ
src/resolvers/Mutation/leaveOrganization.ts 98.36% <93.75%> (-1.64%) ⬇️
src/resolvers/DirectChat/organization.ts 100.00% <100.00%> (ø)
src/resolvers/GroupChat/organization.ts 100.00% <100.00%> (ø)
src/resolvers/Mutation/acceptMembershipRequest.ts 100.00% <100.00%> (ø)
src/resolvers/Mutation/addOrganizationImage.ts 100.00% <100.00%> (ø)
src/resolvers/Mutation/addUserToGroupChat.ts 100.00% <100.00%> (ø)
src/resolvers/Mutation/adminRemoveEvent.ts 100.00% <100.00%> (ø)
src/resolvers/Mutation/adminRemoveGroup.ts 100.00% <100.00%> (ø)
src/resolvers/Mutation/blockUser.ts 100.00% <100.00%> (ø)
src/resolvers/Mutation/cancelMembershipRequest.ts 100.00% <100.00%> (ø)
... and 25 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@nitishkumar333
Copy link
Contributor Author

Hi @palisadoes, please give feedback on it.

@palisadoes palisadoes merged commit ef33a33 into PalisadoesFoundation:develop Sep 20, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User Update fails if email not changed
3 participants