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