je veux juste eviter les erreurs 500
This commit is contained in:
parent
05529d299b
commit
868572a1e2
@ -67,7 +67,6 @@ export class EnfantsService {
|
|||||||
relations: [
|
relations: [
|
||||||
'parentLinks',
|
'parentLinks',
|
||||||
'parentLinks.parent',
|
'parentLinks.parent',
|
||||||
'parentLinks.parent.user',
|
|
||||||
],
|
],
|
||||||
order: { last_name: 'ASC', first_name: 'ASC' }
|
order: { last_name: 'ASC', first_name: 'ASC' }
|
||||||
});
|
});
|
||||||
@ -81,7 +80,6 @@ export class EnfantsService {
|
|||||||
relations: [
|
relations: [
|
||||||
'parentLinks',
|
'parentLinks',
|
||||||
'parentLinks.parent',
|
'parentLinks.parent',
|
||||||
'parentLinks.parent.user',
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
if (!child) {
|
if (!child) {
|
||||||
@ -92,7 +90,7 @@ export class EnfantsService {
|
|||||||
|
|
||||||
// Mettre à jour un enfant
|
// Mettre à jour un enfant
|
||||||
// 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 } });
|
const child = await this.childrenRepository.findOne({ where: { id } });
|
||||||
if (!child) {
|
if (!child) {
|
||||||
throw new NotFoundException(`Id d'enfant : ${id} introuvable`);
|
throw new NotFoundException(`Id d'enfant : ${id} introuvable`);
|
||||||
@ -101,7 +99,7 @@ async update(id: string, dto: Partial<CreateEnfantsDto>): Promise<Children> {
|
|||||||
// On n’a plus besoin de gérer id_parent ici
|
// On n’a plus besoin de gérer id_parent ici
|
||||||
await this.childrenRepository.update(id, dto);
|
await this.childrenRepository.update(id, dto);
|
||||||
return this.findOne(id);
|
return this.findOne(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Supprimer un enfant
|
// Supprimer un enfant
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user