Fixing issue found by Mitch, with syncing not functioning for singular role updates.
This commit is contained in:
parent
3a8e08d3cc
commit
ce47eb6cff
|
@ -115,19 +115,19 @@ exports.syncUser = async function (ctx) {
|
|||
tableId: InternalTables.USER_METADATA,
|
||||
}
|
||||
}
|
||||
let combined
|
||||
if (deleting) {
|
||||
combined = {
|
||||
let combined = !deleting
|
||||
? combineMetadataAndUser(user, metadata)
|
||||
: {
|
||||
...metadata,
|
||||
status: UserStatus.INACTIVE,
|
||||
metadata: BUILTIN_ROLE_IDS.PUBLIC,
|
||||
}
|
||||
} else {
|
||||
combined = combineMetadataAndUser(user, metadata)
|
||||
}
|
||||
// if its null then there was no updates required
|
||||
if (combined) {
|
||||
await db.put(combined)
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx.body = {
|
||||
message: "User synced.",
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue