Browse Source

[PM-24414] Remove CollectionType property from the public CollectionResponseModel (#6180)

pull/6191/head
Rui Tomé 4 months ago committed by GitHub
parent
commit
87877aeb3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      src/Api/Models/Public/Response/CollectionResponseModel.cs
  2. 1
      test/Api.Test/Public/Controllers/CollectionsControllerTests.cs

6
src/Api/Models/Public/Response/CollectionResponseModel.cs

@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
using System.ComponentModel.DataAnnotations;
using Bit.Api.AdminConsole.Public.Models.Response;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Data;
namespace Bit.Api.Models.Public.Response;
@ -24,7 +23,6 @@ public class CollectionResponseModel : CollectionBaseModel, IResponseModel @@ -24,7 +23,6 @@ public class CollectionResponseModel : CollectionBaseModel, IResponseModel
Id = collection.Id;
ExternalId = collection.ExternalId;
Groups = groups?.Select(c => new AssociationWithPermissionsResponseModel(c));
Type = collection.Type;
}
/// <summary>
@ -43,8 +41,4 @@ public class CollectionResponseModel : CollectionBaseModel, IResponseModel @@ -43,8 +41,4 @@ public class CollectionResponseModel : CollectionBaseModel, IResponseModel
/// The associated groups that this collection is assigned to.
/// </summary>
public IEnumerable<AssociationWithPermissionsResponseModel> Groups { get; set; }
/// <summary>
/// The type of this collection
/// </summary>
public CollectionType Type { get; set; }
}

1
test/Api.Test/Public/Controllers/CollectionsControllerTests.cs

@ -67,7 +67,6 @@ public class CollectionsControllerTests @@ -67,7 +67,6 @@ public class CollectionsControllerTests
var jsonResult = Assert.IsType<JsonResult>(result);
var response = Assert.IsType<CollectionResponseModel>(jsonResult.Value);
Assert.Equal(collection.Id, response.Id);
Assert.Equal(collection.Type, response.Type);
}
[Theory, BitAutoData]

Loading…
Cancel
Save