mirror of
https://github.com/bitwarden/server
synced 2025-12-17 00:33:23 +00:00
collection groups management
This commit is contained in:
@@ -8,6 +8,7 @@ using Bit.Core.Models.Api;
|
||||
using Bit.Core.Exceptions;
|
||||
using Bit.Core.Services;
|
||||
using Bit.Core;
|
||||
using Bit.Core.Models.Data;
|
||||
|
||||
namespace Bit.Api.Controllers
|
||||
{
|
||||
@@ -91,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.Groups?.Select(g => g.ToSelectionReadOnly()));
|
||||
return new CollectionResponseModel(collection);
|
||||
}
|
||||
|
||||
@@ -105,7 +106,8 @@ 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.Groups?.Select(g => g.ToSelectionReadOnly()));
|
||||
return new CollectionResponseModel(collection);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user