From b0edc7b965c7cf10124399c586d29e0a188747a7 Mon Sep 17 00:00:00 2001 From: Martin Ledvinka Date: Mon, 5 Aug 2024 10:41:14 +0200 Subject: [PATCH] [Fix] Fix accidental DTO usage when removing vocabulary. --- .../cvut/kbss/termit/service/business/VocabularyService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java b/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java index e0374c4f8..ff5ec6430 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java @@ -282,8 +282,9 @@ public void runTextAnalysisOnAllVocabularies() { @Transactional @PreAuthorize("@vocabularyAuthorizationService.canRemove(#asset)") public void remove(Vocabulary asset) { - aclService.findFor(asset).ifPresent(aclService::remove); - repositoryService.remove(asset); + Vocabulary toRemove = repositoryService.findRequired(asset.getUri()); + aclService.findFor(toRemove).ifPresent(aclService::remove); + repositoryService.remove(toRemove); } /**