mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 17:12:49 -05:00
Folder APIs to new tables
This commit is contained in:
@ -13,19 +13,17 @@ namespace Bit.Core.Models.Api
|
||||
[StringLength(300)]
|
||||
public string Name { get; set; }
|
||||
|
||||
public Cipher ToCipher(Guid userId)
|
||||
public Folder ToFolder(Guid userId)
|
||||
{
|
||||
return ToCipher(new Cipher
|
||||
return ToFolder(new Folder
|
||||
{
|
||||
UserId = userId
|
||||
});
|
||||
}
|
||||
|
||||
public Cipher ToCipher(Cipher existingFolder)
|
||||
public Folder ToFolder(Folder existingFolder)
|
||||
{
|
||||
existingFolder.Data = JsonConvert.SerializeObject(new FolderDataModel(this), new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
|
||||
existingFolder.Type = Core.Enums.CipherType.Folder;
|
||||
|
||||
existingFolder.Name = Name;
|
||||
return existingFolder;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user