This commit is contained in:
ditiqi 2025-02-23 21:41:14 +08:00
parent 4ea794b438
commit e212ec788b
1 changed files with 1 additions and 1 deletions

View File

@ -139,7 +139,7 @@ export class BaseTreeService<
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({
where: { descendantId: result.id },
});