From 21d1313b69f37b8c2f712fa0493ce2492a703b4c Mon Sep 17 00:00:00 2001 From: Melina Gutierrez Date: Mon, 11 Nov 2024 15:00:45 -0400 Subject: [PATCH] #45-Registro Semanal de Horas Trabajadas corregir employee solucionar error --- .../primefactorsolutions/repositories/EmployeeRepository.java | 2 +- .../java/com/primefactorsolutions/service/EmployeeService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java b/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java index 3f09154..d57397f 100644 --- a/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java +++ b/src/main/java/com/primefactorsolutions/repositories/EmployeeRepository.java @@ -11,7 +11,7 @@ public interface EmployeeRepository extends JpaRepository { Optional findByUsername(String username); Optional findByPersonalEmail(String personalEmail); - Optional findByTeamIdAndLeadManagerTrue(UUID teamId); + Optional findByTeamId(UUID teamId); List findByTeamName(String teamName); } diff --git a/src/main/java/com/primefactorsolutions/service/EmployeeService.java b/src/main/java/com/primefactorsolutions/service/EmployeeService.java index 646278a..52c15dd 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.findByTeamIdAndLeadManagerTrue(teamId); + Optional leadManager = employeeRepository.findByTeamId(teamId); return leadManager.map(employee -> employee.getFirstName() + " " + employee.getLastName()) .orElse("No asignado");