Skip to content
Snippets Groups Projects
Commit adcc65d4 authored by Labros Papadopoulos's avatar Labros Papadopoulos
Browse files

Fix get operation bug

parent 6c6711c1
No related branches found
No related tags found
1 merge request!25Tmf 674 feature
Pipeline #6233 passed
...@@ -65,14 +65,14 @@ public class GeographicSiteManagementApiController implements GeographicSiteMana ...@@ -65,14 +65,14 @@ public class GeographicSiteManagementApiController implements GeographicSiteMana
Individual ind = individualRepoService.findByUsername(principal.getName()); Individual ind = individualRepoService.findByUsername(principal.getName());
GeographicSite gs= geographicSiteManagementService.findGeographicSiteByRelatedPartyId(ind.getId()); GeographicSite gs= geographicSiteManagementService.findGeographicSiteByRelatedPartyId(ind.getId());
return new ResponseEntity<>(gs,HttpStatus.OK); return new ResponseEntity<GeographicSite>(gs,HttpStatus.OK);
} else if ( authentication.getAuthorities().contains( new SimpleGrantedAuthority( UserRoleType.ROLE_ADMIN.getValue() ) ) ){ } else if ( authentication.getAuthorities().contains( new SimpleGrantedAuthority( UserRoleType.ROLE_ADMIN.getValue() ) ) ){
return new ResponseEntity<GeographicSite>(geographicSiteManagementService.findGeographicSiteByUUID(id), HttpStatus.OK);
}else { }else {
return new ResponseEntity< GeographicSite >(HttpStatus.FORBIDDEN ); return new ResponseEntity< GeographicSite >(HttpStatus.FORBIDDEN );
} }
return new ResponseEntity<>(geographicSiteManagementService.findGeographicSiteByUUID(id), HttpStatus.OK);
} catch (Exception e) { } catch (Exception e) {
log.error(COULD_NOT_SERIALIZE, e); log.error(COULD_NOT_SERIALIZE, e);
......
...@@ -39,6 +39,11 @@ public class GeographicSiteManagementService { ...@@ -39,6 +39,11 @@ public class GeographicSiteManagementService {
public GeographicSite findGeographicSiteByRelatedPartyId(String uuid){ public GeographicSite findGeographicSiteByRelatedPartyId(String uuid){
Optional<GeographicSite> gs=geographicSiteManagementRepository.findByRelatedPartyId(uuid); Optional<GeographicSite> gs=geographicSiteManagementRepository.findByRelatedPartyId(uuid);
try {
log.info("Found geographic site from related party:{} , geographic site info: {}", uuid, gs.orElse(null).toString());
}catch(Exception e){
log.error("Error during fetch of geographic site info: {}", e.getMessage());
}
return gs.orElse(null); return gs.orElse(null);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment