api
api copied to clipboard
Chore: refactor membership deleting so users can leave workspaces on their own
This ticket is two fold: currently, a workspace member cannot leave on their own volition. An owner must remove them:
https://github.com/open-sauced/api/blob/edd1a379e4d307c1df9f74cc1e7ed247e5e0d8cf/src/workspace/workspace-members.service.ts#L233-L241
This was also in service of not letting there be an "orphaned" workspace with no owner.
We should refactor this to support:
- Members can leave workspaces at will
- The last owner of a workspace cannot leave