Fix: AFW sync no longer overwrites user department on update, rename labels to Renewal
This commit is contained in:
parent
d482c6fe2a
commit
ff6135da5c
1 changed files with 3 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue