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

apis for org settings & billing

This commit is contained in:
Kyle Spearrin
2017-04-06 16:52:39 -04:00
parent 8ab363cc73
commit 2d7cb1321b
6 changed files with 182 additions and 3 deletions

View File

@ -54,7 +54,7 @@ namespace Bit.Api.Controllers
}
[HttpGet("{id}/billing")]
public async Task<OrganizationResponseModel> GetBilling(string id)
public async Task<OrganizationBillingResponseModel> GetBilling(string id)
{
var orgIdGuid = new Guid(id);
if(!_currentContext.OrganizationOwner(orgIdGuid))
@ -68,9 +68,13 @@ namespace Bit.Api.Controllers
throw new NotFoundException();
}
// TODO: billing stuff
var billingInfo = await _organizationService.GetBillingAsync(organization);
if(billingInfo == null)
{
throw new NotFoundException();
}
return new OrganizationResponseModel(organization);
return new OrganizationBillingResponseModel(organization, billingInfo);
}
[HttpGet("")]