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

[BE] - "Update users" route should handle removing identity #38

Open
deepakvenkat opened this issue Oct 11, 2021 · 0 comments
Open

[BE] - "Update users" route should handle removing identity #38

deepakvenkat opened this issue Oct 11, 2021 · 0 comments
Assignees

Comments

@deepakvenkat
Copy link
Member

As a logged in user, when I remove an identity from the front end, then data should be updated.

Bug :

  1. Create a user with n identities ('Gay', 'Black', 'Male', 'Queer)
  2. Using the PUT /users/:id route try to update the identities by removing one of them from the list. (i.e. send only 'Gay', 'Black', 'Male' in the identities_attributes)

Expected result

User should have only Gay, Black, Male in the identities list

Actual Result

User has : Gay, Black, Male, Queer, Gay, Black, Male in their identities list.

Notes

This is because the controller uses rails' relationship params to update identities which probably does not know how to deal with removing relationship data and just creates new relationship rows in the join table https://github.com/outintech/nbjc-app/blob/main/app/controllers/api/v1/users_controller.rb#L64

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

No branches or pull requests

2 participants