fix item ancestors
This commit is contained in:
parent
bf94b41c53
commit
e41d6cf8fd
|
@ -40,8 +40,8 @@ export class ItemsService {
|
|||
relations: ['parent'],
|
||||
},
|
||||
);
|
||||
// TreeRepository.findAncestors()[0] is always the child item
|
||||
return (await this.treeRepository.findAncestors(childItem)).slice(1);
|
||||
// TreeRepository.findAncestors()[-1] is always the child item itself
|
||||
return (await this.treeRepository.findAncestors(childItem)).slice(0, -1);
|
||||
}
|
||||
|
||||
async getItemChildren(item: ItemModel): Promise<Item[]> {
|
||||
|
|
Loading…
Reference in a new issue