RED-3620: Fixed remove from dictionary
This commit is contained in:
parent
1d1de6caba
commit
32a907f697
@ -99,8 +99,13 @@ public class DictionaryService {
|
||||
}
|
||||
|
||||
Set<DictionaryEntry> entries = new HashSet<>();
|
||||
var newEntries = convertEntries(t.getId(), currentVersion);
|
||||
var newValues = newEntries.stream().map(v -> v.getValue()).collect(Collectors.toSet());
|
||||
|
||||
// add old entries from existing DictionaryModel
|
||||
oldModel.ifPresent(dictionaryModel -> entries.addAll(dictionaryModel.getEntries()));
|
||||
oldModel.ifPresent(dictionaryModel -> entries.addAll(dictionaryModel.getEntries().stream().filter(
|
||||
f -> !newValues.contains(f.getValue())).collect(Collectors.toList())
|
||||
));
|
||||
// Add Increments
|
||||
entries.addAll(convertEntries(t.getId(), currentVersion));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user