je veux juste eviter les erreurs 500

This commit is contained in:
sdraris 2025-10-01 16:13:16 +02:00
parent 05529d299b
commit 868572a1e2

View File

@ -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) {
@ -92,7 +90,7 @@ export class EnfantsService {
// Mettre à jour un enfant
// Mettre à jour un enfant
async update(id: string, dto: Partial<CreateEnfantsDto>): Promise<Children> {
async update(id: string, dto: Partial<CreateEnfantsDto>): Promise<Children> {
const child = await this.childrenRepository.findOne({ where: { id } });
if (!child) {
throw new NotFoundException(`Id d'enfant : ${id} introuvable`);
@ -101,7 +99,7 @@ async update(id: string, dto: Partial<CreateEnfantsDto>): Promise<Children> {
// On na plus besoin de gérer id_parent ici
await this.childrenRepository.update(id, dto);
return this.findOne(id);
}
}
// Supprimer un enfant