Skip to content

Commit

Permalink
refactor: Change acceptCode and activateUser method
Browse files Browse the repository at this point in the history
  • Loading branch information
arturhasparian committed Feb 20, 2024
1 parent 732f447 commit 4991b6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public ResponseEntity<?> getNewRefreshToken(@RequestBody JwtResponse response) t
),
@ApiResponse(responseCode = "400", description = "Bad Request")
})
public ResponseEntity<?> activateUser(@RequestBody ActivateRequest request) {
userService.activateUser(request.getCode());
public ResponseEntity<?> activateUser(@PathVariable("code") String code) {
userService.activateUser(code);
return ResponseUtil.ok("User activated successfully!");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public ResponseEntity<?> forgotPassword(@RequestBody ForgotPasswordRequest reque
@ApiResponse(responseCode = "200", description = "Ok"),
@ApiResponse(responseCode = "400", description = "Bad request")
})
public ResponseEntity<?> acceptCode(@RequestBody ActivateRequest request) {
var userDTO = userService.resetUniqueCode(request.getCode());
public ResponseEntity<?> acceptCode(@PathVariable("code") String code) {
var userDTO = userService.resetUniqueCode(code);
return ResponseUtil.create("Ok", HttpStatus.OK, userDTO);
}

Expand Down

0 comments on commit 4991b6a

Please sign in to comment.