Skip to content

Commit

Permalink
Fix #5268 delete virtual study
Browse files Browse the repository at this point in the history
It wasn't possible to delete a virtual study from query page, because it was
sending POST instead of PUT
  • Loading branch information
inodb committed Nov 20, 2018
1 parent 0cfc49e commit 7b37293
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 7b37293

Please sign in to comment.