add
This commit is contained in:
parent
4ea794b438
commit
e212ec788b
|
@ -139,7 +139,7 @@ export class BaseTreeService<
|
||||||
|
|
||||||
const result: any = await super.update(anyArgs, { tx: transaction });
|
const result: any = await super.update(anyArgs, { tx: transaction });
|
||||||
|
|
||||||
if (anyArgs.data.parentId !== current.parentId) {
|
if (anyArgs.data.parentId && anyArgs.data.parentId !== current.parentId) {
|
||||||
await transaction[this.ancestryType].deleteMany({
|
await transaction[this.ancestryType].deleteMany({
|
||||||
where: { descendantId: result.id },
|
where: { descendantId: result.id },
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue