1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

leave org apis

This commit is contained in:
Kyle Spearrin
2017-04-12 10:07:27 -04:00
parent 7afa3f5d1b
commit 1cf38397f3
7 changed files with 61 additions and 0 deletions

View File

@ -188,6 +188,19 @@ namespace Bit.Api.Controllers
await _organizationService.ReinstateSubscriptionAsync(orgIdGuid);
}
[HttpPost("{id}/leave")]
public async Task Leave(string id)
{
var orgGuidId = new Guid(id);
if(!_currentContext.OrganizationUser(orgGuidId))
{
throw new NotFoundException();
}
var userId = _userService.GetProperUserId(User);
await _organizationService.DeleteUserAsync(orgGuidId, userId.Value);
}
[HttpDelete("{id}")]
[HttpPost("{id}/delete")]
public async Task Delete(string id, [FromBody]OrganizationDeleteRequestModel model)