je veux juste eviter les erreurs 500
This commit is contained in:
parent
05529d299b
commit
868572a1e2
@ -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<CreateEnfantsDto>): Promise<Children> {
|
||||
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<CreateEnfantsDto>): Promise<Children> {
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user