(Feat-Fix): Fixed the check-in, check-out system, added a contractor payment system.
This commit is contained in:
@@ -221,9 +221,11 @@ router.post("/", authenticateToken, authorize("SuperAdmin"), async (ctx) => {
|
||||
}
|
||||
|
||||
// Update the employee's department and contractor
|
||||
// If no target contractor specified, keep the original contractor
|
||||
const newContractorId = targetContractorId || employee.contractor_id || null;
|
||||
const [updateResult] = await connection.execute(
|
||||
"UPDATE users SET department_id = ?, contractor_id = ? WHERE id = ?",
|
||||
[targetDepartmentId, targetContractorId || null, employeeId],
|
||||
[targetDepartmentId, newContractorId, employeeId],
|
||||
);
|
||||
|
||||
const affectedRows =
|
||||
|
||||
Reference in New Issue
Block a user