Skip to content

Commit

Permalink
#137 FIX delete list
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentD06 committed Jun 25, 2024
1 parent 7d256e8 commit ac7e92d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
*

Expand Down
3 changes: 3 additions & 0 deletions runtime/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import javax.inject.Inject;
import java.util.Collection;
import java.util.Optional;

public class LookupService {

Expand Down Expand Up @@ -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> 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> lookupTableDto = this.lookupTableService.get(lookupTableName);
if (lookupTableDto.isPresent()) {
this.lookupTableService.delete(lookupTableDto.get().id());
}
}
}

0 comments on commit ac7e92d

Please sign in to comment.