data model updates

This commit is contained in:
Kyle Spearrin 2019-04-16 11:09:05 -04:00
parent 351c99fb42
commit f76051d362
2 changed files with 4 additions and 5 deletions

View file

@ -1,5 +1,4 @@
using Bit.Core.Models.Api; using Bit.Core.Models.Response;
using Bit.Core.Models.Response;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -10,7 +9,7 @@ namespace Bit.Core.Models.Data
{ {
public CipherData() { } public CipherData() { }
public CipherData(CipherResponse response, string userId = null, List<string> collectionIds = null) public CipherData(CipherResponse response, string userId = null, HashSet<string> collectionIds = null)
{ {
Id = response.Id; Id = response.Id;
OrganizationId = response.OrganizationId; OrganizationId = response.OrganizationId;
@ -23,7 +22,7 @@ namespace Bit.Core.Models.Data
Type = response.Type; Type = response.Type;
Name = response.Name; Name = response.Name;
Notes = response.Notes; Notes = response.Notes;
CollectionIds = collectionIds != null ? collectionIds : response.CollectionIds; CollectionIds = collectionIds?.ToList() ?? response.CollectionIds;
switch(Type) switch(Type)
{ {

View file

@ -4,7 +4,7 @@ namespace Bit.Core.Models.Data
{ {
public class CollectionData : Data public class CollectionData : Data
{ {
public CollectionData(CollectionResponse response) public CollectionData(CollectionDetailsResponse response)
{ {
Id = response.Id; Id = response.Id;
OrganizationId = response.OrganizationId; OrganizationId = response.OrganizationId;