This commit is contained in:
harid 2026-01-09 16:37:24 +07:00
parent f0334c69fc
commit 65789c6ac6

View file

@ -615,15 +615,15 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise<boolean> {
await posMasterAssignRepository.save(newAssigns);
}
// Clone permissionProfiles
const perms = permissionMap.get(item.orgRoot.ancestorDNA);
const newRootId = newRootMap.get(item.orgRoot.ancestorDNA);
if (perms && perms.length > 0 && newRootId) {
const newPerms = perms.map(({ id, ...fields }) => ({
...fields,
orgRootId: newRootId,
}));
await permissionProfilesRepository.save(newPerms);
}
// const perms = permissionMap.get(item.ancestorDNA);
// const newRootId = newRootMap.get(item.orgRoot.ancestorDNA);
// if (perms && perms.length > 0 && newRootId) {
// const newPerms = perms.map(({ id, ...fields }) => ({
// ...fields,
// orgRootId: newRootId,
// }));
// await permissionProfilesRepository.save(newPerms);
// }
if (item.next_holderId != null) {
const profile = await repoProfile.findOne({