1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 17:12:49 -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

@ -10,6 +10,7 @@ namespace Bit.Api.Models
{
[StringLength(36)]
public string FolderId { get; set; }
public bool Favorite { get; set; }
[Required]
[EncryptedString]
[StringLength(300)]
@ -40,6 +41,7 @@ namespace Bit.Api.Models
public Cipher ToCipher(Cipher existingSite)
{
existingSite.FolderId = string.IsNullOrWhiteSpace(FolderId) ? null : (Guid?)new Guid(FolderId);
existingSite.Favorite = Favorite;
existingSite.Data = JsonConvert.SerializeObject(new SiteDataModel(this), new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
existingSite.Type = Core.Enums.CipherType.Site;