Commit 4e48a817 authored by Martin Lowe's avatar Martin Lowe 🇨🇦
Browse files

Merge branch 'dev' into 'master'

Patch issues regarding empty lists in resource call

See merge request !446
parents e9f3a5fe 711d1a81
Pipeline #1530 passed with stage
in 0 seconds
...@@ -623,7 +623,7 @@ public class OrganizationResource extends AbstractRESTResource { ...@@ -623,7 +623,7 @@ public class OrganizationResource extends AbstractRESTResource {
// get unique person IDs to query for more details. // get unique person IDs to query for more details.
List<String> ids = people.entrySet().stream().flatMap(e -> e.getValue().stream()).distinct() List<String> ids = people.entrySet().stream().flatMap(e -> e.getValue().stream()).distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
LOGGER.debug("Found {} people with relations {} for organization {}", ids.size(), relations, organizationID); LOGGER.info("Found {} people with relations {} for organization {}", ids.size(), relations, organizationID);
// create the params for cachekey // create the params for cachekey
MultivaluedMap<String, String> params = new MultivaluedMapImpl<>(); MultivaluedMap<String, String> params = new MultivaluedMapImpl<>();
params.put(DefaultUrlParameterNames.IDS.getName(), ids); params.put(DefaultUrlParameterNames.IDS.getName(), ids);
...@@ -648,7 +648,7 @@ public class OrganizationResource extends AbstractRESTResource { ...@@ -648,7 +648,7 @@ public class OrganizationResource extends AbstractRESTResource {
return out; return out;
}); });
if (rawPeopleData.isEmpty()) { if (rawPeopleData.isEmpty()) {
return null; return Collections.emptyList();
} }
LOGGER.debug("Mapped {} relations of {} for org {}", rawPeopleData.get().size(), ids.size(), organizationID); LOGGER.debug("Mapped {} relations of {} for org {}", rawPeopleData.get().size(), ids.size(), organizationID);
return rawPeopleData.get().stream().map(p -> { return rawPeopleData.get().stream().map(p -> {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment