1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

backwards compat for folders in cipher listing

This commit is contained in:
Kyle Spearrin
2017-04-19 16:47:12 -04:00
parent d87441c9fe
commit 54f58ba14d
4 changed files with 49 additions and 3 deletions

View File

@ -0,0 +1,14 @@
using Bit.Core.Models.Table;
namespace Bit.Core.Models.Api
{
public class FolderDataModel
{
public FolderDataModel(Folder folder)
{
Name = folder.Name;
}
public string Name { get; set; }
}
}

View File

@ -31,6 +31,21 @@ namespace Bit.Core.Models.Api
}
}
[Obsolete]
public CipherMiniResponseModel(Folder folder, string obj = "cipherMini")
: base(obj)
{
if(folder == null)
{
throw new ArgumentNullException(nameof(folder));
}
Id = folder.Id.ToString();
Type = Enums.CipherType.Folder;
RevisionDate = folder.RevisionDate;
Data = new FolderDataModel(folder);
}
public string Id { get; set; }
public string OrganizationId { get; set; }
public Enums.CipherType Type { get; set; }
@ -47,6 +62,11 @@ namespace Bit.Core.Models.Api
Favorite = cipher.Favorite;
}
[Obsolete]
public CipherResponseModel(Folder folder, string obj = "cipher")
: base(folder, obj)
{ }
public string FolderId { get; set; }
public bool Favorite { get; set; }
}