monster-ui
monster-ui copied to clipboard
OOB: Delete user related entites with object_types
Requires:
- https://github.com/2600hz/kazoo-crossbar/pull/344
The goal of this PR is to leverage the new object_types[]
parameter that can be passed on user delete requests to trigger the subsequent deletion of entities associated with the user being deleted.
Most of the changes revolve around breaking down the process into three step:
- fetching of entities related to a user when reassignment is necessary (i.e. entities shouldn't be delete)
- reassigning entities requested
- deleting user and associated entities
A lot of the logic related to entities reassignment was simplified by using PATCH requests in place of the GET/POST combo.