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

cipher details with subvaults api

This commit is contained in:
Kyle Spearrin
2017-04-04 17:22:47 -04:00
parent 854c4f7871
commit 7d9a2cdd95
6 changed files with 71 additions and 3 deletions

View File

@ -44,6 +44,21 @@ namespace Bit.Api.Controllers
return new CipherResponseModel(cipher);
}
[HttpGet("{id}/full-details")]
public async Task<CipherFullDetailsResponseModel> GetDetails(string id)
{
var userId = _userService.GetProperUserId(User).Value;
var cipherId = new Guid(id);
var cipher = await _cipherRepository.GetFullDetailsByIdAsync(cipherId, userId);
if(cipher == null)
{
throw new NotFoundException();
}
var subvaultCiphers = await _subvaultCipherRepository.GetManyByUserIdCipherIdAsync(userId, cipherId);
return new CipherFullDetailsResponseModel(cipher, subvaultCiphers);
}
[HttpGet("")]
public async Task<ListResponseModel<CipherResponseModel>> Get()
{
@ -53,7 +68,7 @@ namespace Bit.Api.Controllers
return new ListResponseModel<CipherResponseModel>(responses);
}
[HttpGet("subvaults")]
[HttpGet("details")]
public async Task<ListResponseModel<CipherDetailsResponseModel>> GetSubvaults()
{
var userId = _userService.GetProperUserId(User).Value;