diff --git a/src/routes/enfants/enfants.service.ts b/src/routes/enfants/enfants.service.ts index e39d04e..3b9af54 100644 --- a/src/routes/enfants/enfants.service.ts +++ b/src/routes/enfants/enfants.service.ts @@ -77,9 +77,7 @@ export class EnfantsService { async findOne(id: string): Promise { const child = await this.childrenRepository.findOne({ where: { id }, - relations: [ - 'parentLinks', - ], + relations: ['parentLinks', 'parentLinks.parent'], // charge aussi le parent }); if (!child) { throw new NotFoundException(`Id d'enfant : ${id} introuvable`); @@ -88,7 +86,6 @@ export class EnfantsService { return child; } - // Mettre à jour un enfant // Mettre à jour un enfant async update(id: string, dto: Partial): Promise { const child = await this.childrenRepository.findOne({ where: { id } });