bugfix(user): eliminado findByUsername en el controlador

parent 5ac10f33
...@@ -34,8 +34,8 @@ public class ReadRecipeController { ...@@ -34,8 +34,8 @@ public class ReadRecipeController {
public ResponseEntity<Page<RecipeOutputDto>> readAll(@RequestParam(required = false, defaultValue = "0") int page, public ResponseEntity<Page<RecipeOutputDto>> readAll(@RequestParam(required = false, defaultValue = "0") int page,
@RequestParam(required = false, defaultValue = "6") int size) { @RequestParam(required = false, defaultValue = "6") int size) {
Pageable pageable = PageRequest.of(page, size); Pageable pageable = PageRequest.of(page, size);
String username = SecurityContextHolder.getContext().getAuthentication().getName(); String email = SecurityContextHolder.getContext().getAuthentication().getName();
User user = readUserUseCase.readByUsername(username); User user = readUserUseCase.readByEmail(email);
if (service.readAllByUser(user.getId(), pageable).isEmpty()) { if (service.readAllByUser(user.getId(), pageable).isEmpty()) {
return ResponseEntity.noContent().build(); return ResponseEntity.noContent().build();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment