From 49372bed38ccb4e7b6f92e8bc91aead028cf6af7 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 24 Nov 2017 11:53:15 -0500 Subject: [PATCH] always update associations on group/coll updates --- src/Core/Services/Implementations/CollectionService.cs | 4 ++-- src/Core/Services/Implementations/GroupService.cs | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Core/Services/Implementations/CollectionService.cs b/src/Core/Services/Implementations/CollectionService.cs index 92269d84f..ff5016d0e 100644 --- a/src/Core/Services/Implementations/CollectionService.cs +++ b/src/Core/Services/Implementations/CollectionService.cs @@ -61,13 +61,13 @@ namespace Bit.Core.Services } else { - if(groups == null || !org.UseGroups) + if(!org.UseGroups) { await _collectionRepository.ReplaceAsync(collection); } else { - await _collectionRepository.ReplaceAsync(collection, groups); + await _collectionRepository.ReplaceAsync(collection, groups ?? new List()); } } } diff --git a/src/Core/Services/Implementations/GroupService.cs b/src/Core/Services/Implementations/GroupService.cs index 70ab256f6..079067744 100644 --- a/src/Core/Services/Implementations/GroupService.cs +++ b/src/Core/Services/Implementations/GroupService.cs @@ -50,15 +50,7 @@ namespace Bit.Core.Services else { group.RevisionDate = DateTime.UtcNow; - - if(collections == null) - { - await _groupRepository.ReplaceAsync(group); - } - else - { - await _groupRepository.ReplaceAsync(group, collections); - } + await _groupRepository.ReplaceAsync(group, collections ?? new List()); } } }