1
0
mirror of https://github.com/bitwarden/server synced 2025-12-13 06:43:45 +00:00

cipher details create/update

This commit is contained in:
Kyle Spearrin
2017-03-18 23:41:46 -04:00
parent 3d5437e238
commit 26b553c248
16 changed files with 159 additions and 44 deletions

View File

@@ -1,7 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using Bit.Core.Utilities;
using Bit.Core.Models.Table;
using Newtonsoft.Json;
using Core.Models.Data;
@@ -29,15 +28,15 @@ namespace Bit.Core.Models.Api
[StringLength(10000)]
public string Notes { get; set; }
public CipherDetails ToCipher(Guid userId)
public CipherDetails ToCipherDetails(Guid userId)
{
return ToCipher(new CipherDetails
return ToCipherDetails(new CipherDetails
{
UserId = userId
});
}
public CipherDetails ToCipher(CipherDetails existingLogin)
public CipherDetails ToCipherDetails(CipherDetails existingLogin)
{
existingLogin.FolderId = string.IsNullOrWhiteSpace(FolderId) ? null : (Guid?)new Guid(FolderId);
existingLogin.Favorite = Favorite;