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:
@ -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]
|
||||
|
Reference in New Issue
Block a user