Fix: AFW sync no longer overwrites user department on update, rename labels to Renewal

This commit is contained in:
lorentz 2026-04-09 15:01:11 +00:00
parent d482c6fe2a
commit ff6135da5c

View file

@ -195,10 +195,11 @@ async function syncEmployees(
const userData = mapAfwEmployeeToUser(afwEmployee)
if (existingUser) {
// Update existing user
// Update existing user — exclude department to preserve manually-set values
const { department: _dept, ...updateData } = userData
await prisma.user.update({
where: { id: existingUser.id },
data: userData,
data: updateData,
})
updated++
} else {