diff --git a/src/Api/Controllers/CollectionsController.cs b/src/Api/Controllers/CollectionsController.cs index 1bc8a60ab..dab97618b 100644 --- a/src/Api/Controllers/CollectionsController.cs +++ b/src/Api/Controllers/CollectionsController.cs @@ -92,7 +92,7 @@ namespace Bit.Api.Controllers } var collection = model.ToCollection(orgIdGuid); - await _collectionService.SaveAsync(collection, model?.GroupIds.Select(g => new Guid(g))); + await _collectionService.SaveAsync(collection, model.GroupIds?.Select(g => new Guid(g))); return new CollectionResponseModel(collection); } @@ -106,7 +106,7 @@ namespace Bit.Api.Controllers throw new NotFoundException(); } - await _collectionService.SaveAsync(model.ToCollection(collection), model?.GroupIds.Select(g => new Guid(g))); + await _collectionService.SaveAsync(model.ToCollection(collection), model.GroupIds?.Select(g => new Guid(g))); return new CollectionResponseModel(collection); } diff --git a/src/Core/Models/Api/Response/CollectionResponseModel.cs b/src/Core/Models/Api/Response/CollectionResponseModel.cs index d1685a09e..e42d5d07a 100644 --- a/src/Core/Models/Api/Response/CollectionResponseModel.cs +++ b/src/Core/Models/Api/Response/CollectionResponseModel.cs @@ -40,13 +40,13 @@ namespace Bit.Core.Models.Api public class CollectionDetailsResponseModel : CollectionResponseModel { - public CollectionDetailsResponseModel(Collection collection, IEnumerable collectionIds) + public CollectionDetailsResponseModel(Collection collection, IEnumerable groupIds) : base(collection, "collectionDetails") { - CollectionIds = collectionIds; + GroupIds = groupIds; } - public IEnumerable CollectionIds { get; set; } + public IEnumerable GroupIds { get; set; } } public class CollectionUserDetailsResponseModel : CollectionResponseModel