Skip to content

Commit

Permalink
Merge pull request #5297 from inodb/fix-session-service-put
Browse files Browse the repository at this point in the history
Fix #5268 delete virtual study
  • Loading branch information
inodb authored Nov 20, 2018
2 parents 0cfc49e + 7b37293 commit 4493084
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void addUsertoVirtualStudy(@PathVariable String id,
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

if (!StringUtils.isEmpty(sessionServiceURL) && authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) {
updateVirutalStudyUser(id,
updateVirtualStudyUser(id,
((UserDetails)authentication.getPrincipal()).getUsername(),
Operation.add,
response);
Expand All @@ -168,7 +168,7 @@ public void removeUserFromVirtualStudy(@PathVariable String id,
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

if (!StringUtils.isEmpty(sessionServiceURL) && authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) {
updateVirutalStudyUser(id,
updateVirtualStudyUser(id,
((UserDetails)authentication.getPrincipal()).getUsername(),
Operation.delete,
response);
Expand Down Expand Up @@ -214,7 +214,7 @@ private Map addSession(SessionType type,
}


private void updateVirutalStudyUser(String id,
private void updateVirtualStudyUser(String id,
String user,
Operation operation,
HttpServletResponse response) throws IOException {
Expand All @@ -240,7 +240,7 @@ private void updateVirutalStudyUser(String id,
RestTemplate restTemplate = new RestTemplate();
HttpEntity<Object> httpEntity = new HttpEntity<Object>(virtualStudy.getData(), getHttpHeaders());

restTemplate.exchange(sessionServiceURL + SessionType.virtual_study + "/" + id, HttpMethod.POST, httpEntity, HashMap.class);
restTemplate.exchange(sessionServiceURL + SessionType.virtual_study + "/" + id, HttpMethod.PUT, httpEntity, HashMap.class);

} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit 4493084

Please sign in to comment.