[Admin Tools | Trunk]: pom.xml: Increased version to 2.0.3 | ManagerService.java: Change response in method "getManagers()" to get them via role management instead of user management.

This commit is contained in:
Konstantina Galouni 2022-07-29 09:45:45 +00:00
parent a9cc44c443
commit 99e01c7662
2 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.dnetlib</groupId>
<artifactId>uoa-admin-tools</artifactId>
<version>2.0.2-SNAPSHOT</version>
<version>2.0.3-SNAPSHOT</version>
<packaging>war</packaging>
<name>uoa-admin-tools</name>
<!-- Use parent with artifact spring-boot-starter-parent and add plugin with artifact spring-boot-maven-plugin in order to run springboot run command-->

View File

@ -30,10 +30,10 @@ public class ManagerService {
public Manager[] getManagers(String pid, Type type) {
String url = (type == Type.EMAIL)?config.getEmail():config.getId();
ResponseEntity<Response> responseEntity = restTemplate.getForEntity(url.replace("{community}", pid), Response.class);
Response response = responseEntity.getBody();
if (response != null && responseEntity.getStatusCode() == HttpStatus.OK) {
return response.getResponse();
ResponseEntity<Manager[]> responseEntity = restTemplate.getForEntity(url.replace("{community}", pid), Manager[].class);
Manager[] managers = responseEntity.getBody();
if (managers != null && responseEntity.getStatusCode() == HttpStatus.OK) {
return managers;
} else {
throw new ContentNotFoundException("No managers has been found for community " + pid);
}