From 868572a1e2b9d226cccd60f4263c69d312a92b38 Mon Sep 17 00:00:00 2001 From: sdraris Date: Wed, 1 Oct 2025 16:13:16 +0200 Subject: [PATCH] je veux juste eviter les erreurs 500 --- src/routes/enfants/enfants.service.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/routes/enfants/enfants.service.ts b/src/routes/enfants/enfants.service.ts index 926ab29..911e1e5 100644 --- a/src/routes/enfants/enfants.service.ts +++ b/src/routes/enfants/enfants.service.ts @@ -67,7 +67,6 @@ export class EnfantsService { relations: [ 'parentLinks', 'parentLinks.parent', - 'parentLinks.parent.user', ], order: { last_name: 'ASC', first_name: 'ASC' } }); @@ -81,7 +80,6 @@ export class EnfantsService { relations: [ 'parentLinks', 'parentLinks.parent', - 'parentLinks.parent.user', ], }); if (!child) { @@ -91,17 +89,17 @@ export class EnfantsService { } // Mettre à jour un enfant - // Mettre à jour un enfant -async update(id: string, dto: Partial): Promise { - const child = await this.childrenRepository.findOne({ where: { id } }); - if (!child) { - throw new NotFoundException(`Id d'enfant : ${id} introuvable`); - } + // Mettre à jour un enfant + async update(id: string, dto: Partial): Promise { + const child = await this.childrenRepository.findOne({ where: { id } }); + if (!child) { + throw new NotFoundException(`Id d'enfant : ${id} introuvable`); + } - // On n’a plus besoin de gérer id_parent ici - await this.childrenRepository.update(id, dto); - return this.findOne(id); -} + // On n’a plus besoin de gérer id_parent ici + await this.childrenRepository.update(id, dto); + return this.findOne(id); + } // Supprimer un enfant