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

Allow deletion of multiple users #149

Merged
merged 3 commits into from
Oct 25, 2018

Conversation

mraerino
Copy link
Member

@mraerino mraerino commented Oct 25, 2018

Fixes #136

- Summary

In order to delete multiple users issue a DELETE call to /users.
Multiple id query parameters will determine which users should be deleted.

Example:

DELETE /users?id=user1&id=user2&id=user3

This is the closest you get to implementing bulk deletion in REST.
It should also be compatible to how qs (js lib) handles a parameter with multiple values. (Use { indices: false } in the options.)

This action is meant to be idempotent:
If you pass ids which don't exist it will not result in an error. This enables sending the same request multiple times if the first request failed and only some users got deleted. Although internally it uses a transaction to rollback changes if one delete fails, idempotency is still a best practice for this.

- Test plan

There is a new test suite TestUserBulkDelete with 5 different test cases.

- Description for the changelog

Allow deletion of multiple users

Expects a DELETE call agains `/users` with a query like `?id=x&id=y`.
This action is idempotent. Deletion of non-existent users will not
throw an error.
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.

Bulk delete multiple users
2 participants