fix(#168): typage colonne placement garde courant compatible TypeORM.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-24 00:51:06 +02:00
co-authored by Cursor
parent db08aca714
commit 93ee3a5549
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -28,14 +28,14 @@ export class Parents {
/** /**
* Placement AM↔enfant sélectionné sur le TdB parent (couple actif) — ticket #168. * Placement AM↔enfant sélectionné sur le TdB parent (couple actif) — ticket #168.
* Null = le front prend le premier couple actif retourné par l’API. * Null / absent = le front prend le premier couple actif retourné par l’API.
*/ */
@Column({ name: 'id_placement_garde_courant', type: 'uuid', nullable: true }) @Column({ name: 'id_placement_garde_courant', type: 'uuid', nullable: true })
id_placement_garde_courant?: string | null; id_placement_garde_courant?: string;
@ManyToOne(() => AmChildren, { nullable: true, onDelete: 'SET NULL' }) @ManyToOne(() => AmChildren, { nullable: true, onDelete: 'SET NULL' })
@JoinColumn({ name: 'id_placement_garde_courant', referencedColumnName: 'id' }) @JoinColumn({ name: 'id_placement_garde_courant', referencedColumnName: 'id' })
placement_garde_courant?: AmChildren | null; placement_garde_courant?: AmChildren;
// Lien vers enfants via la table enfants_parents // Lien vers enfants via la table enfants_parents
@OneToMany(() => ParentsChildren, pc => pc.parent) @OneToMany(() => ParentsChildren, pc => pc.parent)
@@ -543,7 +543,7 @@ export class ParentsService {
idCourant = null; idCourant = null;
await this.parentsRepository.update( await this.parentsRepository.update(
{ user_id: parentUserId }, { user_id: parentUserId },
{ id_placement_garde_courant: null }, { id_placement_garde_courant: () => 'NULL' },
); );
} }
if (!idCourant && placements.length === 1) { if (!idCourant && placements.length === 1) {