fix bug: add ancestorDNA org all leavel
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m11s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m11s
This commit is contained in:
parent
82ecf2cb81
commit
d916334537
5 changed files with 15 additions and 0 deletions
|
|
@ -204,6 +204,9 @@ export class OrgChild1Controller {
|
||||||
child1.orgChild1Order =
|
child1.orgChild1Order =
|
||||||
order == null || order.orgChild1Order == null ? 1 : order.orgChild1Order + 1;
|
order == null || order.orgChild1Order == null ? 1 : order.orgChild1Order + 1;
|
||||||
await this.child1Repository.save(child1, { data: request });
|
await this.child1Repository.save(child1, { data: request });
|
||||||
|
// update ancestorDNA = id row
|
||||||
|
child1.ancestorDNA = child1.id;
|
||||||
|
await this.child1Repository.save(child1, { data: request });
|
||||||
setLogDataDiff(request, { before, after: child1 });
|
setLogDataDiff(request, { before, after: child1 });
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,9 @@ export class OrgChild2Controller extends Controller {
|
||||||
child2.orgChild2Order =
|
child2.orgChild2Order =
|
||||||
order == null || order.orgChild2Order == null ? 1 : order.orgChild2Order + 1;
|
order == null || order.orgChild2Order == null ? 1 : order.orgChild2Order + 1;
|
||||||
await this.child2Repository.save(child2, { data: request });
|
await this.child2Repository.save(child2, { data: request });
|
||||||
|
// update ancestorDNA = id row
|
||||||
|
child2.ancestorDNA = child2.id;
|
||||||
|
await this.child2Repository.save(child2, { data: request });
|
||||||
setLogDataDiff(request, { before, after: child2 });
|
setLogDataDiff(request, { before, after: child2 });
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,9 @@ export class OrgChild3Controller {
|
||||||
child3.orgChild3Order =
|
child3.orgChild3Order =
|
||||||
order == null || order.orgChild3Order == null ? 1 : order.orgChild3Order + 1;
|
order == null || order.orgChild3Order == null ? 1 : order.orgChild3Order + 1;
|
||||||
await this.child3Repository.save(child3, { data: request });
|
await this.child3Repository.save(child3, { data: request });
|
||||||
|
// update ancestorDNA = id row
|
||||||
|
child3.ancestorDNA = child3.id;
|
||||||
|
await this.child3Repository.save(child3, { data: request });
|
||||||
setLogDataDiff(request, { before, after: child3 });
|
setLogDataDiff(request, { before, after: child3 });
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,9 @@ export class OrgChild4Controller extends Controller {
|
||||||
child4.orgChild4Order =
|
child4.orgChild4Order =
|
||||||
order == null || order.orgChild4Order == null ? 1 : order.orgChild4Order + 1;
|
order == null || order.orgChild4Order == null ? 1 : order.orgChild4Order + 1;
|
||||||
await this.child4Repository.save(child4, { data: request });
|
await this.child4Repository.save(child4, { data: request });
|
||||||
|
// update ancestorDNA = id row
|
||||||
|
child4.ancestorDNA = child4.id;
|
||||||
|
await this.child4Repository.save(child4, { data: request });
|
||||||
setLogDataDiff(request, { before, after: child4 });
|
setLogDataDiff(request, { before, after: child4 });
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,9 @@ export class OrgRootController extends Controller {
|
||||||
orgRoot.lastUpdatedAt = new Date();
|
orgRoot.lastUpdatedAt = new Date();
|
||||||
orgRoot.orgRootOrder = order == null || order.orgRootOrder == null ? 1 : order.orgRootOrder + 1;
|
orgRoot.orgRootOrder = order == null || order.orgRootOrder == null ? 1 : order.orgRootOrder + 1;
|
||||||
await this.orgRootRepository.save(orgRoot, { data: request });
|
await this.orgRootRepository.save(orgRoot, { data: request });
|
||||||
|
// update ancestorDNA = id row
|
||||||
|
orgRoot.ancestorDNA = orgRoot.id;
|
||||||
|
await this.orgRootRepository.save(orgRoot, { data: request });
|
||||||
setLogDataDiff(request, { before, after: orgRoot });
|
setLogDataDiff(request, { before, after: orgRoot });
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue