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

storage adjustment and billing fixes

This commit is contained in:
Kyle Spearrin
2017-07-11 10:59:59 -04:00
parent a8ff190fb5
commit b49c16f529
6 changed files with 51 additions and 14 deletions

View File

@ -395,7 +395,7 @@ namespace Bit.Api.Controllers
throw new UnauthorizedAccessException();
}
await _userService.AdjustStorageAsync(user, model.StroageGbAdjustment.Value);
await _userService.AdjustStorageAsync(user, model.StorageGbAdjustment.Value);
}
[HttpPut("cancel-premium")]

View File

@ -168,6 +168,19 @@ namespace Bit.Api.Controllers
await _organizationService.AdjustSeatsAsync(orgIdGuid, model.SeatAdjustment.Value);
}
[HttpPut("{id}/storage")]
[HttpPost("{id}/storage")]
public async Task PutStorage(string id, [FromBody]StorageRequestModel model)
{
var orgIdGuid = new Guid(id);
if(!_currentContext.OrganizationOwner(orgIdGuid))
{
throw new NotFoundException();
}
await _organizationService.AdjustStorageAsync(orgIdGuid, model.StorageGbAdjustment.Value);
}
[HttpPut("{id}/cancel")]
[HttpPost("{id}/cancel")]
public async Task PutCancel(string id)