fix(employees): fix update employees

This commit is contained in:
Matthieu Haineault 2025-12-03 15:43:03 -05:00
parent f19f981b43
commit f8a70deed2

View File

@ -31,7 +31,10 @@ export class EmployeesUpdateService {
email: dto.email, email: dto.email,
phone_number: dto.phone_number, phone_number: dto.phone_number,
residence: dto.residence, residence: dto.residence,
user_module_access: { },
});
await tx.userModuleAccess.upsert({
where: { user_id: user_id.data },
update: { update: {
dashboard: normalized_access.dashboard, dashboard: normalized_access.dashboard,
employee_list: normalized_access.employee_list, employee_list: normalized_access.employee_list,
@ -40,7 +43,14 @@ export class EmployeesUpdateService {
timesheets: normalized_access.timesheets, timesheets: normalized_access.timesheets,
timesheets_approval: normalized_access.timesheets_approval, timesheets_approval: normalized_access.timesheets_approval,
}, },
}, create: {
user_id: user_id.data,
dashboard: normalized_access.dashboard,
employee_list: normalized_access.employee_list,
employee_management: normalized_access.employee_management,
personal_profile: normalized_access.personal_profile,
timesheets: normalized_access.timesheets,
timesheets_approval: normalized_access.timesheets_approval,
}, },
}); });
return tx.employees.update({ return tx.employees.update({