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

Added favorites to ciphers and exposed PUT favorite cipher API

This commit is contained in:
Kyle Spearrin
2016-06-08 22:19:08 -04:00
parent ed0c6ad795
commit 4f59f38326
6 changed files with 22 additions and 1 deletions

View File

@ -70,6 +70,20 @@ namespace Bit.Api.Controllers
model.FolderRelationships);
}
[HttpPut("{id}/favorite")]
public async Task Favorite(string id)
{
var cipher = await _cipherRepository.GetByIdAsync(new Guid(id), new Guid(_userManager.GetUserId(User)));
if(cipher == null)
{
throw new NotFoundException();
}
cipher.Favorite = !cipher.Favorite;
await _cipherRepository.ReplaceAsync(cipher);
}
[HttpDelete("{id}")]
public async Task Delete(string id)
{