Pull request #184: fixed dictionary add corner case

Merge in RED/redaction-service from redaction-log-backend-preview-remove-code-duplication-from-ui to master

* commit 'cc1c3122bb3a4704a8ca1ff858a35f335d7d058b':
  fixed dictionary add  corner case
This commit is contained in:
Timo Bejan 2021-07-12 10:06:27 +02:00
commit 80c68d6278

View File

@ -640,7 +640,15 @@ public class RedactionLogCreatorService {
redactionLogEntry.setDictionaryEntry(manualRedaction.isAddToDossierDictionary());
redactionLogEntry.setDossierDictionaryEntry(manualRedaction.isAddToDossierDictionary());
redactionLog.getRedactionLogEntry().add(redactionLogEntry);
var found = redactionLog.getRedactionLogEntry().stream().filter(r -> r.getId().equalsIgnoreCase(redactionLogEntry.getId())).findAny();
if (found.isPresent()) {
found.get().setDictionaryEntry(manualRedaction.isAddToDossierDictionary());
found.get().setDossierDictionaryEntry(manualRedaction.isAddToDossierDictionary());
} else {
redactionLog.getRedactionLogEntry().add(redactionLogEntry);
}
}
}
}