1
0
mirror of https://github.com/bitwarden/server synced 2025-12-20 10:13:39 +00:00

Folder APIs to new tables

This commit is contained in:
Kyle Spearrin
2017-03-18 11:35:41 -04:00
parent d7a1cd1ce3
commit 2b71420818
9 changed files with 84 additions and 76 deletions

View File

@@ -1,35 +0,0 @@
using System;
using Bit.Core.Models.Table;
using Newtonsoft.Json;
namespace Bit.Core.Models.Api
{
public class FolderDataModel
{
public FolderDataModel() { }
public FolderDataModel(FolderRequestModel folder)
{
Name = folder.Name;
}
public FolderDataModel(CipherRequestModel cipher)
{
Name = cipher.Name;
}
public FolderDataModel(Cipher cipher)
{
if(cipher.Type != Core.Enums.CipherType.Folder)
{
throw new ArgumentException("Cipher is not correct type.");
}
var data = JsonConvert.DeserializeObject<FolderDataModel>(cipher.Data);
Name = data.Name;
}
public string Name { get; set; }
}
}