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

feat: Ignore duplicate adding user to project #844

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

david-code
Copy link
Contributor

@david-code david-code commented Sep 29, 2023

For adding a user to a project, the plan is to use the project info in the redux store in the app to determine if a user belongs to a project. This would create a corner case where a user might be added to the same project twice. (Actually, I think that would exist regardless). This commit just treats that case a succesful operation and does nothing, which seems like the simplest solution to me. In the future we might want to return different error statuses if the user was already added.

Description

Checklist

  • Corresponding issue has been opened
  • New tests added

Related Issues

Related somewhat to techmatters/terraso-mobile-client#37

Verification steps

The plan is to use the project info in the redux store in the app to
determine if a user belongs to a project. This would create a corner
case where a user might be added to the same project twice. (Actually,
I think that would exist regardless). This commit just treats that
case a succesful operation and does nothing.
@david-code david-code requested a review from shrouxm September 29, 2023 13:54
Copy link
Member

@shrouxm shrouxm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

was the behavior before this PR failing with an unhelpful error message because of a unique constraint violation?

@david-code
Copy link
Contributor Author

LGTM!

was the behavior before this PR failing with an unhelpful error message because of a unique constraint violation?

Yep, that's right.

@david-code david-code merged commit 3cd1b29 into main Oct 4, 2023
@david-code david-code deleted the fix/add-user-project-ignore-duplicate branch October 4, 2023 19:29
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.

2 participants