-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Allow any team member (including leaders) to leave their current team. Special handling is required when the team leader leaves, which should trigger team disbandment.
Below is what the new user and teams object fields look like for future reference

Specifics
Method: POST
Path: /teams/leave
Return: 200 on successful leave, appropriate error codes for validation failures
Schema:
// Request body
{
"auth_token": "string",
"auth_email": "string",
"team_id": "string"
}// Response body (success)
{
"statusCode": 200,
"body": {
"message": "Successfully left team",
}
}Implementation Logic:
- Validate user is actually a member of the specified team
- Remove user's email from team's members array
- Clear user's
team_infoobject and setconfirmed_team = false - Special case: If leaving user is team leader, call team
disbandendpoint
Edge Cases:
- User tries to leave team they're not in
- Team already disbanded
- Concurrent leave operations
- Leader leaves when team has pending invitations
Team Disbandment Integration:
When team leader leaves, automatically trigger the disband workflow:
- Call
/teams/disbandendpoint internally - Ensure all remaining members are properly cleaned up
- Handle any pending invitations to the disbanded team
Deliverables:
- Implement endpoint with validation and error handling
- Write unit tests including leader succession scenarios
- Integration testing with team disband functionality
- Depending on time of creating this endpoint, the
disbandendpoint may not be done yet
- Depending on time of creating this endpoint, the
Metadata
Metadata
Assignees
Labels
No labels