1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

react to contact changes not being set from identity

This commit is contained in:
Kyle Spearrin
2017-01-24 22:46:54 -05:00
parent 9a10382b46
commit 0648c2d0a3
13 changed files with 104 additions and 84 deletions

View File

@ -33,12 +33,12 @@ namespace Bit.Api.Models
[StringLength(10000)]
public string Notes { get; set; }
public virtual Cipher ToCipher(string userId = null)
public virtual Cipher ToCipher(Guid userId)
{
var cipher = new Cipher
{
Id = new Guid(Id),
UserId = new Guid(userId),
UserId = userId,
FolderId = string.IsNullOrWhiteSpace(FolderId) ? null : (Guid?)new Guid(FolderId),
Type = Type
};

View File

@ -19,11 +19,11 @@ namespace Bit.Api.Models
[StringLength(255)]
public string PushToken { get; set; }
public Device ToDevice(string userId = null)
public Device ToDevice(Guid? userId = null)
{
return ToDevice(new Device
{
UserId = userId == null ? default(Guid) : new Guid(userId)
UserId = userId == null ? default(Guid) : userId.Value
});
}

View File

@ -13,11 +13,11 @@ namespace Bit.Api.Models
[StringLength(300)]
public string Name { get; set; }
public Cipher ToCipher(string userId = null)
public Cipher ToCipher(Guid userId)
{
return ToCipher(new Cipher
{
UserId = new Guid(userId)
UserId = userId
});
}

View File

@ -28,11 +28,11 @@ namespace Bit.Api.Models
[StringLength(10000)]
public string Notes { get; set; }
public Cipher ToCipher(string userId = null)
public Cipher ToCipher(Guid userId)
{
return ToCipher(new Cipher
{
UserId = new Guid(userId)
UserId = userId
});
}