|
if (incomingParameters?.org_short_name) { |
|
// Remove us from the old users Array |
|
const filteredUuids = registryOrg.users.filter(uuid => uuid !== registryUser.UUID) |
|
registryOrg.users = filteredUuids |
|
// Add us to the new org (this is a genuine cross-org migration, so we must fetch the new org) |
|
const newOrg = await baseOrgRepository.getOrgObject(incomingParameters.org_short_name) |
|
newOrg.users = [...new Set([...newOrg.users, registryUser.UUID])] |
|
|
|
if (registryUser.role.includes('ADMIN')) { |
|
newOrg.admins = [...new Set([...(newOrg.admins || []), registryUser.UUID])] |
|
} |
|
|
|
legacyUser.org_UUID = newOrg.UUID |
|
await newOrg.save(options) |
|
} |
This Secretariat-only code path has no step for "Remove us from the old admins Array" (if present there).
cve-services/src/repositories/baseUserRepository.js
Lines 447 to 461 in 791d31f
This Secretariat-only code path has no step for "Remove us from the old admins Array" (if present there).