mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
[EC-495] Updated GroupService.SaveAsync to check if collections are supplied and prevent deleting Group-to-Collection associations. Added unit test. (#2234)
This commit is contained in:
@ -61,7 +61,16 @@ public class GroupService : IGroupService
|
||||
else
|
||||
{
|
||||
group.RevisionDate = DateTime.UtcNow;
|
||||
await _groupRepository.ReplaceAsync(group, collections ?? new List<SelectionReadOnly>());
|
||||
|
||||
if (collections == null)
|
||||
{
|
||||
await _groupRepository.ReplaceAsync(group);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _groupRepository.ReplaceAsync(group, collections);
|
||||
}
|
||||
|
||||
await _eventService.LogGroupEventAsync(group, Enums.EventType.Group_Updated);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user