fix: script insert
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m23s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m23s
This commit is contained in:
parent
0f4bee4489
commit
d555c70af9
1 changed files with 10 additions and 3 deletions
|
|
@ -7983,8 +7983,15 @@ export class OrganizationController extends Controller {
|
|||
// OrgRoot (sync first - no parent dependencies)
|
||||
// If we manually created orgRootCurrent, skip syncOrgLevel and set up mapping directly
|
||||
// to avoid double insert (syncOrgLevel would try to insert again because IDs don't match)
|
||||
let orgRootResult: { mapping: OrgIdMapping; counts: { deleted: number; updated: number; inserted: number } };
|
||||
if (orgRootCurrent && orgRootDraft && orgRootCurrent.ancestorDNA === orgRootDraft.ancestorDNA) {
|
||||
let orgRootResult: {
|
||||
mapping: OrgIdMapping;
|
||||
counts: { deleted: number; updated: number; inserted: number };
|
||||
};
|
||||
if (
|
||||
orgRootCurrent &&
|
||||
orgRootDraft &&
|
||||
orgRootCurrent.ancestorDNA === orgRootDraft.ancestorDNA
|
||||
) {
|
||||
// Manually created - set up mapping directly
|
||||
const rootMapping: OrgIdMapping = {
|
||||
byAncestorDNA: new Map([[orgRootDraft.ancestorDNA, orgRootCurrent.id]]),
|
||||
|
|
@ -8479,7 +8486,7 @@ export class OrganizationController extends Controller {
|
|||
for (const draft of toInsert) {
|
||||
const newNode: any = queryRunner.manager.create(entityClass, {
|
||||
...draft,
|
||||
id: draft.id,
|
||||
id: undefined,
|
||||
orgRevisionId: currentRevisionId,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue