small fixes

This commit is contained in:
Eduard Heimbuch
2019-08-01 09:57:18 +02:00
parent 853bf133ca
commit 2fe8c154d3
3 changed files with 14 additions and 5 deletions

View File

@@ -29,11 +29,13 @@ public class AvailablePluginResource {
private final PluginDtoCollectionMapper collectionMapper;
private final PluginManager pluginManager;
private final PluginDtoMapper mapper;
@Inject
public AvailablePluginResource(PluginDtoCollectionMapper collectionMapper, PluginManager pluginManager) {
public AvailablePluginResource(PluginDtoCollectionMapper collectionMapper, PluginManager pluginManager, PluginDtoMapper mapper) {
this.collectionMapper = collectionMapper;
this.pluginManager = pluginManager;
this.mapper = mapper;
}
/**
@@ -79,7 +81,7 @@ public class AvailablePluginResource {
.filter(p -> p.getId().equals(name + ":" + version))
.findFirst();
if (plugin.isPresent()) {
return Response.ok(plugin.get()).build();
return Response.ok(mapper.map(plugin.get())).build();
} else {
throw notFound(entity(Plugin.class, name));
}