fixed method deleting repository admin by email

This commit is contained in:
Konstantinos Spyrou 2021-07-12 14:07:37 +00:00
parent 301e680136
commit 95929e6587
1 changed files with 3 additions and 3 deletions

View File

@ -282,10 +282,10 @@ public class RepositoryController {
/**
* Unsubscribe from repo by email
*/
@RequestMapping(method = RequestMethod.DELETE, path = "{id}/admins/{email}")
@RequestMapping(method = RequestMethod.DELETE, path = "{id}/admins/{email:.+}")
@PreAuthorize("hasAnyAuthority('ROLE_ADMIN', 'ROLE_PROVIDE_ADMIN') or @authorizationService.isMemberOf(#id)")
public Response unsubscribeByEmail(@PathVariable("id") String id, @PathVariable("email") String email) throws ResourceNotFoundException {
public ResponseEntity<Void> unsubscribeByEmail(@PathVariable("id") String id, @PathVariable("email") String email) throws ResourceNotFoundException {
authorizationService.removeAdmin(id, email);
return Response.status(HttpStatus.OK.value()).entity(JsonUtils.createResponse("Role has been removed").toString()).type(javax.ws.rs.core.MediaType.APPLICATION_JSON).build();
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
}