From 2094b5cf23ad59e88eb0806d76cebde01a18d859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Such=C3=A1nek?= Date: Sun, 12 Jan 2025 15:03:09 +0100 Subject: [PATCH] Fix saving settings --- .../org/fairdatapoint/service/settings/SettingsService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/fairdatapoint/service/settings/SettingsService.java b/src/main/java/org/fairdatapoint/service/settings/SettingsService.java index 774b0659..881ab159 100644 --- a/src/main/java/org/fairdatapoint/service/settings/SettingsService.java +++ b/src/main/java/org/fairdatapoint/service/settings/SettingsService.java @@ -123,10 +123,8 @@ private List updateSources(SettingsUpdateDTO dto, Se private List updateSearchFilters(SettingsUpdateDTO dto, Settings settings) { // Delete old - settings - .getSearchFilters() - .forEach(searchFilter -> searchFilterItemRepository.deleteAll(searchFilter.getItems())); searchFilterRepository.deleteAll(settings.getSearchFilters()); + entityManager.flush(); // Add new final List searchFilters = new ArrayList<>(); final List dtos = dto.getSearch().getFilters();