Skip to content

Commit

Permalink
fix(RF05): Fixed issue 173 on frontend defect log
Browse files Browse the repository at this point in the history
  • Loading branch information
dembA7 committed May 8, 2024
1 parent 9512dcc commit 1541465
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/app/services/task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ async function updateTask(idTask: string, task: UpdatedTask): Promise<boolean> {
idTask: idTask,
};

const taskIsAssignedAlready = await EmployeeTaskRepository.validateEmployeeTask(task.idEmployee, idTask);
const taskIsAssignedAlready = await EmployeeTaskRepository.validateEmployeeTask(idTask);

if (!taskIsAssignedAlready) {
const assignedTask = await EmployeeTaskRepository.create(newEmployeeTask);
Expand Down
3 changes: 1 addition & 2 deletions src/core/infra/repositories/employee-task.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ async function deleteByTaskId(taskId: string): Promise<void> {
*
* @returns {Promise<boolean>} - True if the task is assigned to the employee, false otherwise.
*/
async function validateEmployeeTask(employeeId: string, taskId: string): Promise<boolean> {
async function validateEmployeeTask(taskId: string): Promise<boolean> {
try {
const data = await Prisma.employee_task.findFirst({
where: {
id_employee: employeeId,
id_task: taskId,
},
});
Expand Down

0 comments on commit 1541465

Please sign in to comment.