Do you want to work on this issue?
You can request for a bounty in order to promote it!
[Improvement] Conditions to Danger Zone action API's #7223
desperado1802 posted onGitHub
We need to allow users to be able to call following API's in certain conditions, described bellow:
-Remove Team - Active only if the count of managers is 1 and current user is manager
path: /organization-team/${id}?organizationId=${organizationId}
,
method: "DELETE",
-Quit Team - Current User is manager and length of managers is more than 1 OR current user is not manager
path: /organization-team-employee/${id}?tenantId=${tenantId}&employeeId=${employeeId}&organizationId=${organizationId}&organizationTeamId=${organizationTeamId}
,
method: 'DELETE',
-Transfer Ownership - Disabled if there are NOT more than 1 manager in the team and current user is manager. I don't think we can implement this one, as it can be used for more than Transfer Ownership, but wanted to share, as what we did in front-end. Also basically we are Unmaking the current user manager, by removing it from managerIds array
path: /organization-team/${id}
,
method: "PUT",