je veux juste eviter les erreurs 500

This commit is contained in:
sdraris 2025-10-01 20:33:05 +02:00
parent ae75a79c2f
commit 80bc815d20

View File

@ -77,9 +77,7 @@ export class EnfantsService {
async findOne(id: string): Promise<Children> {
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<CreateEnfantsDto>): Promise<Children> {
const child = await this.childrenRepository.findOne({ where: { id } });