File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
service/src/main/java/com/appirio/service/review/util Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -76,18 +76,10 @@ public Set<Long> getGroups(long userId) throws Exception {
7676 throw new SupplyException ("Unable to get groups from the API, the returned status code is: " + response .getStatusInfo ().getStatusCode ());
7777 }
7878
79- JsonNode apiResponse = response .readEntity (JsonNode .class );
80- JsonNode result = apiResponse .path ("result" );
81- if (result .path ("status" ).asInt () != HttpStatus .OK_200 ) {
82- LOGGER .error ("Unable to get groups: {}" , apiResponse );
83-
84- throw new SupplyException ("Unable to get groups from the API, the error is: " + result .path ("content" ).asText ());
85- }
86-
87- JsonNode groups = result .path ("content" );
79+ JsonNode result = response .readEntity (JsonNode .class );
8880 Set <Long > groupIds = new HashSet <Long >();
89- for (JsonNode group : groups ) {
90- groupIds .add (group .path ( "id" ). asLong ());
81+ for (JsonNode group : result ) {
82+ groupIds .add (group .asLong ());
9183 }
9284
9385 return groupIds ;
You can’t perform that action at this time.
0 commit comments