mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
include collections in sync
This commit is contained in:
@ -72,7 +72,7 @@ namespace Bit.Core.Models.Api
|
||||
IDictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphers, string obj = "cipherDetails")
|
||||
: base(cipher, globalSettings, obj)
|
||||
{
|
||||
if(collectionCiphers.ContainsKey(cipher.Id))
|
||||
if(collectionCiphers?.ContainsKey(cipher.Id) ?? false)
|
||||
{
|
||||
CollectionIds = collectionCiphers[cipher.Id].Select(c => c.CollectionId);
|
||||
}
|
||||
@ -86,7 +86,7 @@ namespace Bit.Core.Models.Api
|
||||
IEnumerable<CollectionCipher> collectionCiphers, string obj = "cipherDetails")
|
||||
: base(cipher, globalSettings, obj)
|
||||
{
|
||||
CollectionIds = collectionCiphers.Select(c => c.CollectionId);
|
||||
CollectionIds = collectionCiphers?.Select(c => c.CollectionId) ?? new List<Guid>();
|
||||
}
|
||||
|
||||
public IEnumerable<Guid> CollectionIds { get; set; }
|
||||
@ -98,7 +98,7 @@ namespace Bit.Core.Models.Api
|
||||
IDictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphers, string obj = "cipherMiniDetails")
|
||||
: base(cipher, globalSettings, false, obj)
|
||||
{
|
||||
if(collectionCiphers.ContainsKey(cipher.Id))
|
||||
if(collectionCiphers?.ContainsKey(cipher.Id) ?? false)
|
||||
{
|
||||
CollectionIds = collectionCiphers[cipher.Id].Select(c => c.CollectionId);
|
||||
}
|
||||
|
@ -14,18 +14,22 @@ namespace Bit.Core.Models.Api
|
||||
User user,
|
||||
IEnumerable<OrganizationUserOrganizationDetails> organizationUserDetails,
|
||||
IEnumerable<Folder> folders,
|
||||
IEnumerable<CipherDetails> ciphers)
|
||||
IEnumerable<Collection> collections,
|
||||
IEnumerable<CipherDetails> ciphers,
|
||||
IDictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphersDict)
|
||||
: base("sync")
|
||||
{
|
||||
Profile = new ProfileResponseModel(user, organizationUserDetails);
|
||||
Folders = folders.Select(f => new FolderResponseModel(f));
|
||||
Ciphers = ciphers.Select(c => new CipherResponseModel(c, globalSettings));
|
||||
Ciphers = ciphers.Select(c => new CipherDetailsResponseModel(c, globalSettings, collectionCiphersDict));
|
||||
Collections = collections.Select(c => new CollectionResponseModel(c));
|
||||
Domains = new DomainsResponseModel(user, false);
|
||||
}
|
||||
|
||||
public ProfileResponseModel Profile { get; set; }
|
||||
public IEnumerable<FolderResponseModel> Folders { get; set; }
|
||||
public IEnumerable<CipherResponseModel> Ciphers { get; set; }
|
||||
public IEnumerable<CollectionResponseModel> Collections { get; set; }
|
||||
public IEnumerable<CipherDetailsResponseModel> Ciphers { get; set; }
|
||||
public DomainsResponseModel Domains { get; set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user