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

collection groups management

This commit is contained in:
Kyle Spearrin
2017-05-11 12:22:14 -04:00
parent 2b8db4d1ed
commit d7f9977382
9 changed files with 38 additions and 27 deletions

View File

@ -13,7 +13,7 @@ namespace Bit.Core.Models.Api
[EncryptedString]
[StringLength(300)]
public string Name { get; set; }
public IEnumerable<string> GroupIds { get; set; }
public IEnumerable<SelectionReadOnlyRequestModel> Groups { get; set; }
public Collection ToCollection(Guid orgId)
{

View File

@ -1,6 +1,8 @@
using System;
using Bit.Core.Models.Table;
using System.Collections.Generic;
using Bit.Core.Models.Data;
using System.Linq;
namespace Bit.Core.Models.Api
{
@ -26,12 +28,12 @@ namespace Bit.Core.Models.Api
public class CollectionDetailsResponseModel : CollectionResponseModel
{
public CollectionDetailsResponseModel(Collection collection, IEnumerable<Guid> groupIds)
public CollectionDetailsResponseModel(Collection collection, IEnumerable<SelectionReadOnly> groups)
: base(collection, "collectionDetails")
{
GroupIds = groupIds;
Groups = groups.Select(g => new SelectionReadOnlyResponseModel(g));
}
public IEnumerable<Guid> GroupIds { get; set; }
public IEnumerable<SelectionReadOnlyResponseModel> Groups { get; set; }
}
}