When a workspace owner deletes their workspace/organization, it messes up the GET users organizations' endpoint and returns an error.
Intended behaviour:
Frontend should be able to get a list of all the organizations a user belongs to. It should not throw an error if one of those workspaces may have been deleted by the owner.
Proposed fixes
When an organization is deleted, all members of the organization should be deleted in the "members" collection, and the ID of the organization should be removed from a list of organizations a user belongs to.
Modify the error handling so that a "No document" error from mongo does not stop the rest of the data from being returned.
Linear Ticket
Details:
When a workspace owner deletes their workspace/organization, it messes up the GET users organizations' endpoint and returns an error.
Intended behaviour:
Frontend should be able to get a list of all the organizations a user belongs to. It should not throw an error if one of those workspaces may have been deleted by the owner.
Proposed fixes