diff --git a/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java b/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java index 79e228b..90b6919 100644 --- a/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java +++ b/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java @@ -11,6 +11,6 @@ public interface EmployeeRepository extends JpaRepository { Optional findByUsername(String username); Optional findByPersonalEmail(String personalEmail); - Optional findByTeamIdAndLeadManager(UUID teamId); + Optional findByTeamId(UUID teamId); List findByTeamName(String teamName); } \ No newline at end of file diff --git a/src/main/java/com/primefactorsolutions/service/EmployeeService.java b/src/main/java/com/primefactorsolutions/service/EmployeeService.java index ac42734..bb42d32 100644 --- a/src/main/java/com/primefactorsolutions/service/EmployeeService.java +++ b/src/main/java/com/primefactorsolutions/service/EmployeeService.java @@ -50,7 +50,7 @@ public class EmployeeService { public String getTeamLeadName(final UUID teamId) { // Encuentra al empleado con el rol de lead_manager en el equipo especificado - Optional leadManager = employeeRepository.findByTeamIdAndLeadManager(teamId); + Optional leadManager = employeeRepository.findByTeamId(teamId); return leadManager.map(employee -> employee.getFirstName() + " " + employee.getLastName()) .orElse("No asignado");