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,16 +31,26 @@ 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: { },
update: { });
dashboard: normalized_access.dashboard, await tx.userModuleAccess.upsert({
employee_list: normalized_access.employee_list, where: { user_id: user_id.data },
employee_management: normalized_access.employee_management, update: {
personal_profile: normalized_access.personal_profile, dashboard: normalized_access.dashboard,
timesheets: normalized_access.timesheets, employee_list: normalized_access.employee_list,
timesheets_approval: normalized_access.timesheets_approval, employee_management: normalized_access.employee_management,
}, personal_profile: normalized_access.personal_profile,
}, timesheets: normalized_access.timesheets,
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({