fix(employees): fix update employees
This commit is contained in:
parent
f19f981b43
commit
f8a70deed2
|
|
@ -31,16 +31,26 @@ export class EmployeesUpdateService {
|
|||
email: dto.email,
|
||||
phone_number: dto.phone_number,
|
||||
residence: dto.residence,
|
||||
user_module_access: {
|
||||
update: {
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
await tx.userModuleAccess.upsert({
|
||||
where: { user_id: user_id.data },
|
||||
update: {
|
||||
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,
|
||||
},
|
||||
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({
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user