Use user.id instead of user in the path for the "Remove User" delete … #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…action; addresses #21.
As currently coded, the path for the "Remove User"
delete
method does not use the ID of the user who is to removed from the role but rather what I presume is the user'suser_key
, which, if it has the form of an email address, is converted to something of an "escaped" version ... e.g., "user_a@institution-dot-edu". When the code tries to find the user (cf. https://github.com/samvera/hydra-role-management/blob/master/app/controllers/concerns/hydra/role_management/user_roles_behavior.rb#L24 ) in performing the deletion, it is unable to and anActiveRecord::RecordNotFound
error is thrown:This PR fixes this problem by utilizing the work-around noted by @awead in #21 (comment) by which the path for the
delete
method is formulated using theid
of the user; e.g.,http://localhost:3000/roles/3/users/1
.