Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5268 delete virtual study #5297

Merged
merged 1 commit into from
Nov 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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