Skip to content

Commit

Permalink
fix: banUser method fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicente1215 committed Mar 26, 2023
1 parent d556517 commit a6fdde2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ public ResponseEntity<User> banUser(Authentication authentication, @PathVariable
User user = optionalUser.get();
if (user.isLocked()) {
userService.unbanUser(user.getUsername());
user.setLocked(false);
} else {
userService.banUser(user.getUsername());
user.setLocked(true);
}
return new ResponseEntity<>(user, HttpStatus.OK);
}
Expand Down

0 comments on commit a6fdde2

Please sign in to comment.