Bug WISE-16 fixed. Backed completed.

This commit is contained in:
Paulo Gustavo Veiga
2014-01-09 22:38:59 -03:00
parent 914e3b508c
commit 94ac039390
4 changed files with 63 additions and 5 deletions

View File

@@ -117,11 +117,18 @@ public class AdminController extends BaseController {
@RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}", consumes = {"text/plain"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void getUserByEmail(@PathVariable long id) throws WiseMappingException {
public void deleteUserByEmail(@PathVariable long id) throws WiseMappingException {
final User user = userService.getUserBy(id);
if (user == null) {
throw new IllegalArgumentException("User '" + id + "' could not be found");
}
final List<Collaboration> collaborations = mindmapService.findCollaborations(user);
for (Collaboration collaboration : collaborations) {
final Mindmap mindmap = collaboration.getMindMap();
mindmapService.removeMindmap(mindmap,user);
}
userService.deleteUser(user);
}