forked from Ynov/ptitspas-ynov-back
je veux juste eviter les erreurs 500
This commit is contained in:
parent
ae75a79c2f
commit
80bc815d20
@ -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 } });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user