fix typos (descendents -> descendants)
This commit is contained in:
parent
9e22638fc2
commit
96c7856d92
|
@ -23,5 +23,5 @@ export class ItemModel {
|
||||||
children: ItemModel[];
|
children: ItemModel[];
|
||||||
|
|
||||||
@Field((type) => [ItemModel])
|
@Field((type) => [ItemModel])
|
||||||
descendents: ItemModel[];
|
descendants: ItemModel[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,8 @@ export class ItemsResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResolveField()
|
@ResolveField()
|
||||||
async descendents(@Parent() item: ItemModel) {
|
async descendants(@Parent() item: ItemModel) {
|
||||||
return this.itemsService.getItemDescendents(item);
|
return this.itemsService.getItemDescendants(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Mutation((returns) => ItemModel)
|
@Mutation((returns) => ItemModel)
|
||||||
|
|
|
@ -44,7 +44,7 @@ export class ItemsService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getItemDescendents(item: ItemModel): Promise<Item[]> {
|
async getItemDescendants(item: ItemModel): Promise<Item[]> {
|
||||||
const parentItem = await this.itemRepository.findOneOrFail(item.id, {
|
const parentItem = await this.itemRepository.findOneOrFail(item.id, {
|
||||||
relations: ['parent'],
|
relations: ['parent'],
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue