diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b6983da..406ce83c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file. Note : This feature involves an internal updating of the API. The rules must be exported then imported with the new version of the plugin. ### Bug Fixes -* +* List can't be deleted ([issue #137](https://github.com/airbus-cyber/graylog-plugin-alert-wizard/issues/137)) ### Changes * diff --git a/runtime/docker-compose.yml b/runtime/docker-compose.yml index 7b5dd19f..9ba219ed 100644 --- a/runtime/docker-compose.yml +++ b/runtime/docker-compose.yml @@ -9,6 +9,9 @@ services: mongo: image: "mongo:6.0" container_name: mongo + # uncomment to expose mongodb on localhost:27017 + # ports: + # - 27017:27017 # OpenSearch: # * https://hub.docker.com/r/opensearchproject/opensearch diff --git a/src/main/java/com/airbus_cyber_security/graylog/wizard/database/LookupService.java b/src/main/java/com/airbus_cyber_security/graylog/wizard/database/LookupService.java index 35b33be8..d327c99a 100644 --- a/src/main/java/com/airbus_cyber_security/graylog/wizard/database/LookupService.java +++ b/src/main/java/com/airbus_cyber_security/graylog/wizard/database/LookupService.java @@ -31,6 +31,7 @@ import javax.inject.Inject; import java.util.Collection; +import java.util.Optional; public class LookupService { @@ -124,11 +125,17 @@ public void createLookupTable(String adapterIdentifier, String title) { public void deleteDataAdapter(String title) { String adapterName = this.getDataAdapterName(title); - this.dataAdapterService.delete(adapterName); + Optional dataAdapterDto = this.dataAdapterService.get(adapterName); + if (dataAdapterDto.isPresent()) { + this.dataAdapterService.delete(dataAdapterDto.get().id()); + } } public void deleteLookupTable(String title) { String lookupTableName = this.getLookupTableName(title); - this.lookupTableService.delete(lookupTableName); + Optional lookupTableDto = this.lookupTableService.get(lookupTableName); + if (lookupTableDto.isPresent()) { + this.lookupTableService.delete(lookupTableDto.get().id()); + } } }