|
|
|
@ -115,17 +115,17 @@ exports.syncUser = async function (ctx) { |
|
|
|
tableId: InternalTables.USER_METADATA, |
|
|
|
} |
|
|
|
} |
|
|
|
let combined |
|
|
|
if (deleting) { |
|
|
|
combined = { |
|
|
|
...metadata, |
|
|
|
status: UserStatus.INACTIVE, |
|
|
|
metadata: BUILTIN_ROLE_IDS.PUBLIC, |
|
|
|
} |
|
|
|
} else { |
|
|
|
combined = combineMetadataAndUser(user, metadata) |
|
|
|
let combined = !deleting |
|
|
|
? combineMetadataAndUser(user, metadata) |
|
|
|
: { |
|
|
|
...metadata, |
|
|
|
status: UserStatus.INACTIVE, |
|
|
|
metadata: BUILTIN_ROLE_IDS.PUBLIC, |
|
|
|
} |
|
|
|
// if its null then there was no updates required
|
|
|
|
if (combined) { |
|
|
|
await db.put(combined) |
|
|
|
} |
|
|
|
await db.put(combined) |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.body = { |
|
|
|
|