fix item ancestors

master
Lauren Liberda 2021-07-21 02:44:14 +02:00
parent bf94b41c53
commit e41d6cf8fd
1 changed files with 2 additions and 2 deletions

View File

@ -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[]> {