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

remove old share solution code

This commit is contained in:
Kyle Spearrin
2017-02-28 22:51:29 -05:00
parent 321183c570
commit acb1fc0be5
17 changed files with 19 additions and 365 deletions

View File

@ -31,25 +31,25 @@ namespace Bit.Api.Controllers
}
[HttpGet("{id}")]
public async Task<CipherShareResponseModel> Get(string id)
public async Task<CipherResponseModel> Get(string id)
{
var userId = _userService.GetProperUserId(User).Value;
var cipher = await _cipherRepository.GetShareByIdAsync(new Guid(id), userId);
var cipher = await _cipherRepository.GetByIdAsync(new Guid(id), userId);
if(cipher == null)
{
throw new NotFoundException();
}
return new CipherShareResponseModel(cipher, userId);
return new CipherResponseModel(cipher, userId);
}
[HttpGet("")]
public async Task<ListResponseModel<CipherShareResponseModel>> Get()
public async Task<ListResponseModel<CipherResponseModel>> Get()
{
var userId = _userService.GetProperUserId(User).Value;
var ciphers = await _cipherRepository.GetManyShareByUserIdAsync(userId);
var responses = ciphers.Select(c => new CipherShareResponseModel(c, userId));
return new ListResponseModel<CipherShareResponseModel>(responses);
var ciphers = await _cipherRepository.GetManyByUserIdAsync(userId);
var responses = ciphers.Select(c => new CipherResponseModel(c, userId));
return new ListResponseModel<CipherResponseModel>(responses);
}
[Obsolete]